Gang of Four patterns for real systems: how to use them without overengineering
A decision-first guide to read GoF patterns as architecture tools, not as an academic checklist to apply by default.
- #gof
- #patrones-diseño
- #arquitectura
- #sistemas
Executive summary
- Design patterns matter when they respond to a real architecture pressure.
- Senior judgment is in choosing the trade-off, not naming the pattern.
The real problem is not remembering 23 names
Many teams learn patterns as a catalog: Singleton, Factory, Strategy, Adapter. The problem is that they later try to recognize the name before understanding the design pressure.
In real systems the order should be reversed. A force appears first: rules that change, integrations that pollute the domain, objects that are hard to build, flows that depend on state, or consumers that should not know each other.
Four questions before applying a pattern
I use GoF patterns only when they help close an architecture decision:
- Which variability do I need to isolate so change does not break everything?
- Which concrete dependency do I want to invert or encapsulate?
- Which part of the system needs a stable interface?
- Which cost do I accept in exchange for more flexibility?
What a clean decision looks like
A good use of a pattern leaves a named and defensible decision. It does not say "we used Strategy because it is elegant". It says "pricing rules change by segment, so we isolated them as replaceable policies".
type PricingPolicy = { calculate(basePrice: number): number };
const founderDiscount: PricingPolicy = {
calculate: (basePrice) => basePrice * 0.8,
};
const enterprisePricing: PricingPolicy = {
calculate: (basePrice) => basePrice * 1.15,
};When not to use patterns
If the change does not exist yet, if the team cannot explain the trade-off, or if the pattern introduces more concepts than the original problem, wait.
Overengineering usually appears when a pattern is applied to prove seniority, not to reduce risk. In a startup, that complexity is paid through onboarding, debugging and learning speed.
Related evidence
FAQ
- Should GoF patterns be learned in order?
- Not necessarily. For real systems, start with patterns that solve frequent pressures: Strategy, Factory Method, Adapter, Observer, Builder and Facade.
- Are GoF patterns still relevant?
- Yes, but not as universal recipes. They remain useful to name design decisions, discuss trade-offs and organize dependencies.