Choosing Patterns as a Response to Design Pressure
What This Concept Is
A design pattern is a named solution to a recurring pressure in code. It is not an ornament. It is not proof that you read a book. It is a deliberate response to a specific force that is pulling your design out of shape.
Three ideas have to travel together:
- the pressure, named in plain language ("this conditional explodes every time a new payment type is added")
- the pattern that absorbs it (Strategy, Factory, Decorator, and so on)
- the cost the pattern adds (indirection, new files, new vocabulary for teammates)
If you cannot say all three out loud, you are not choosing a pattern. You are decorating.