(This question was closed on Stack Overflow due to being "too broad" and "not a real question" so maybe it's more appropriate here?)

Inspired by this question. We know events are a language-level implementation of the Observer pattern. Are there other design patterns implemented as language features in C#? I want to keep this question C#-specific because there are lots of design patterns implemented in other languages, and I want to keep this focused.

I'm not looking for pattern implementations in the BCL (such as decorator in many WCF classes or Factory Method in WebClient), but language-level patterns.

So far I'm aware of observer (event) and iterator (foreach in combination with many BCL classes and interfaces). There are probably other obvious ones I'm missing.

2 Answers 2


Delegates are de facto strategy patterns

  • funny, just yesterday a collegue was saying delegates are an implementation of the command pattern. Depends on how you look at it I guess (afaik command should encapsulate the arguments as well, but in case of a method without arguments..)
    – stijn
    Commented Mar 25, 2011 at 8:20
  • 1
    I wouldn't say delegates are implementation of command patterns, atleast I can't see how you could implements things like undo/redo using only delegates. They might be part of a command object but that's another matter
    – Homde
    Commented Mar 25, 2011 at 8:41

Extension methods are an abstraction of the Decorator pattern.

  • Not really. Decorator allows us to composed objects at run-time to add data and behaviour. Commented Mar 25, 2011 at 19:28
  • 1
    True - so they're not nearly as useful as real decorator patterns. Would it be better to say that much of the problems solved by extension methods are solved with decorator patterns in other languages?
    – vstrien
    Commented Mar 28, 2011 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.