Understand design pattern in C#