Khaos

Using the Right Pattern

One of the things that can be a problem is that people can think that patterns are unreservedly good and that a test of a program’s quality is how many patterns are in it. This leads to the apocryphal story of a hello world application with three decorators, two strategies, and a singleton in a pear tree. Patterns are not good or bad – rather, they’re either appropriate or not for some situations. I don’t think it’s wrong to experiment with using a pattern when you’re unsure, but you should be prepared to rip it out if it doesn’t contribute enough.

Martin Fowler, Patterns, IEEE Software, March/April 2003, Vol 20, No. 2