Take the 2-minute tour ×

Can you share your most frequently applied (or favorite) software design patterns in .NET development? And why?

Please bear with me by asking such a generic question. I am not trying solve any problem specifically. Simply want to know what patterns are used more frequently to help solving problems we face daily.

Thanks for sharing your two cents.

share|improve this question

5 Answers 5

up vote 11 down vote accepted

There's a saying I once heard:

"The trouble with getting a new hammer is, everything starts to look like a nail"

This question appears to be asking for solutions, with little concern to what the problems actually are. Far too frequently people adopt favourite patterns, and apply them religously whether or not they are the best tool for the job.

If you want to start on design patterns though, I'd suggest by reading one of the many books on the subject such as the classic Gang Of Four book "Design Patterns" by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides, ISBN-13 978-0201633610 or for a more C# flavour, try "C# 3.0 Design Patterns" by Judith Bishop, ISBN-13 978-0596527730.

share|improve this answer
Tip: When referencing published books, it is better to add links to the books (such as pages on Amazon or the publishers site) rather than adding an ISBN number. Most posters prefer to edit their answer with that information because it can be time consuming to find the links. +1 –  Cerebrus Jul 29 '09 at 7:36
I considered doing that (all the information I entered was from Amazon anyway), but decided against on the basis that it's just advertising for Amazon and also it limits it to a single country. I felt the ISBN-13 number allowed the books to be immediately identified, without any of these ties. I am reconsidering this though, given their size - I suppose it's like saying 'no, I don't use google' :-) –  MPritchard Jul 29 '09 at 7:41
OK, caved in and added links. Guess I'm now a sell out :-) –  MPritchard Jul 29 '09 at 7:44
+1 to the answer here. It frustrates me to no end when I see inexperienced developers looking to conform without asking why. Research the problem, then find a solution. If there is a pattern that fits the mold, you'll more than likely come across it during your research. Then, if you have specific questions about a pattern, ask them. Blanket questions like this really don't serve a useful purpose. –  Chris Jul 29 '09 at 8:10
Considering the question, I would have said Head First: Design Patterns, but +1 for the right answer –  Matt Briggs Jul 29 '09 at 17:58

Well if you include the built in ones, it'd have to be Iterator (Enumeration) and Observer (Events) :)

share|improve this answer
  • Composite pattern

Each object have 1 parent and may have n children.

  • Controler pattern

On one side you have classe (DataClass) that represents the data, and on the other 1 classe that contains a list of DataClass (ControlerClass). Only this ControlerClass instanciate/modify/delete any object of DataClass.

  • Singleton Pattern

Allo a class to instanciate only 1 object, by designing the constructors as private, and design a static getter that return either a new object, or the existing object

Many of pattern are used, but these one are really common.

share|improve this answer
Hmm, I was advised to keep away from the Singleton pattern where possible, because it just looks like 1 giant global variable... Which it is when you think about it. Obviously there are some instances where this is desired, but need to be careful. –  Ian Jul 29 '09 at 8:02
There's only one correct implementation for singletons: configuring the class' lifecycle as singleton in the container :) –  Thomas Freudenberg Jul 29 '09 at 8:06

What design pattern do you use the most? : All of them can be applied in the world of .NET.

share|improve this answer

Besides the obvious Iterator and Observer, I would say:

  • Strategy
share|improve this answer

Your Answer


