−When you see this problem | Start with this pattern
Inheritance hierarchies grow too deep | Composition
A policy or algorithm changes frequently | Strategy Pattern
The shape of an external SDK spreads into internal code | Adapter Pattern
Subsystem call sequences become complex | Facade Pattern
You want to add extra behavior without modifying the original object | Decorator Pattern
Nested if blocks grow too deep | Guard Clause
The caller must handle failures directly | Result Pattern
Per-state behavior and transitions are complex | State Pattern
DB details are leaking into domain code | Repository Pattern
Screen queries are forced to drag along the domain model | Query Facade
External calls fail occasionally | Retry + Timeout
A failure in an external dependency is bringing down your system | Circuit Breaker
The same data is read repeatedly | Cache-Aside
+When you see this problem | Start with this pattern
Inheritance hierarchies grow too deep | Composition
A policy or algorithm changes frequently | Strategy Pattern
The shape of an external SDK spreads into internal code | Adapter Pattern
Subsystem call sequences become complex | Facade Pattern
You want to add extra behavior without modifying the original object | Decorator Pattern
Nested if blocks grow too deep | Guard Clause
The caller must handle failures directly | Result Pattern
Per-state behavior and transitions are complex | State Pattern
One object's changes must notify several receivers | Observer Pattern
DB details are leaking into domain code | Repository Pattern
Screen queries are forced to drag along the domain model | Query Facade
External calls fail occasionally | Retry + Timeout
A failure in an external dependency is bringing down your system | Circuit Breaker
The same data is read repeatedly | Cache-Aside