We are constantly facing new design problems. We always solve the problems, but sometimes we find that we have backed ourselves into a corner. Sometimes we find that the solution has serious drawbacks, and sometimes we create bad solutions. By reusing good, well-proven, and flexible solutions we minimize these risks and we reach the desired result faster. A tool to use for this is patterns. Thanks to the higher abstraction level that comes from patterns, we can also start and succeed with even larger design problems. Pattern awareness also leads to better understanding between developerssystem development is very much about communication.
I've heard it many times. Patterns are academic nonsense, useless and elitist. If this is also how you feel, my aim in this chapter is to show you the opposite, because nothing could be more wrong. Patterns can be very pragmatic, highly useful in day-to-day work, and extremely interesting to all (or at least most) developers. Maybe you haven't noticed, but I have already discussed several patterns. One example is the Domain Model pattern [Fowler PoEAA] that I brought up in Chapter 1, "Values to Value." In this chapter, we will discuss three different categories of patterns: namely Design Patterns (generic and application-type specific), Architectural Patterns, and Domain Patterns.
Please note that the categorizations here are a bit fuzzy, and not at all as important or interesting as the patterns themselves. So if the categorizations don't provide any help to you, don't let them get in the way for you.
Even if you are already pattern-conscious, I think you'll find this chapter interesting. I won't reuse old explanations, but will provide my own view of the patterns. For example, the discussion I'm going to use will be very Domain Model-focused, which is not typically the case when it comes to Design Patterns, for example. If nothing else, I hope you'll find the reflections here and there of interest.
Before getting started, though, I'd like to take you through a generic discussion of the concept of patterns and why you should learn about them.