Martijn Martijn - 11 days ago 6
C# Question

When to use which design pattern?

I like design patterns very much, but I find it difficult to see when I can apply one. I have read a lot of websites where design patterns are explained. I do understand the most of them, but I find it difficult to recognize a pattern in my own situations.

So, that is why I ask this question. Are there any guidelines / alarm bells when to use which design pattern.

For example, if you are doing a switch statement to determine which object you need to create, you probably want to use the factory design pattern. So the switch statement in this case is a 'alarm bell' to use the Factory pattern.

So, do you know more 'alarm bells' to determine a design pattern?

J K J K
Answer

For starters just take a peek at this page: http://codebetter.com/jeremymiller/2006/04/11/six-design-patterns-to-start-with/

While Jeremy here deals with a few set of patterns, you must read these articles and then follow it up with this: http://codebetter.com/jeremymiller/2005/09/01/learning-about-design-patterns/

Also use the references on this article(especially Eric Gamma's interview) and you should be set.

Comments