Wisdom applies generally, as principles do, but also in specifics ways when confronted by specific kinds of problems. When these specifics repeat, there is value in sharing the patterns that we discover, giving them names to make them more shareable, and thereby creating a professional vocabulary.
In our profession there are many books on patterns. Trying to “learn all the patterns” is probably too much to ask and also is not necessary. It is more important to understand the principles, practices, and wisdom that underlie all patterns.
Essential Patterns
There are patterns that seem to arise in all domains, and that represent the best examples of the general value of pattern. We consider these to be those essential patterns, those that every developer should know, listed in the order we suggest you learn them.
- Strategy
- Template Method
- Bridge
- Adapter
- Facade
- Analysis Matrix
- Abstract Factory
- Factory Method
- Iterator
- Singleton
- Proxy
- Decorator
- Chain of Responsibility
- Composite
- Object Pool
- Mediator
- Observer
- State
There are other patterns which can be useful to know, and which can deepen the understanding a developer has of the value and nature of patterns overall. Once the list above is mastered, we suggest the following are good patterns to focus on:
- Visitor
- Flyweight
- Builder
Learning Patterns
Design patterns are not “reusable solutions” but instead create a rich language developers use to communicate, collaborate, and make collective decisions about design. When you study design patterns you are teaching yourself what good design is, and why.
Here are helpful resources for learning patterns.
- The Design Patterns Repository. This repository delineates each pattern according to three kinds of forces:
- Contextual forces which help you to discover the appropriate pattern for the problem you are trying to solve.
- Implementation forces, which show you options and concerns when implementing each pattern.
- Consequent forces, which help you to evaluate the cost/benefit of each pattern as well as how to unit test it.
- Design Patterns Thinking (course). This three-day course (21 PDUs) addresses key questions in modern development such as how to design systems that have changeability as a fundamental quality and how the team can communicate effectively when a design is in a constant state of change.
- Books
- Bain, Scott. Emergent Design: The Evolutionary Nature of Professional Software Development. (2008)
- Shalloway and Trott. Design Patterns Explained: A New Perspective on Object Oriented Design. (2004)