Martijn Martijn - 7 months ago 57
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?


For starters just take a peek at this page:

While Jeremy here deals with a few set of patterns, you must read these articles and then follow it up with this:

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