Pattern of programming on C#