The Gang of Four Legacy
In 1994, four engineers — Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides — published Design Patterns: Elements of Reusable Object-Oriented Software.
Introduction
In 1994, four engineers — Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides — published Design Patterns: Elements of Reusable Object-Oriented Software. Their 23 patterns became the shared dictionary the industry never had. Three decades later, the names still appear in Spring source code, Kubernetes controllers, React docs, and senior interview loops.
This lesson covers what GoF got right (vocabulary, structure, trade-offs), what aged poorly (heavy C++/Smalltalk syntax, no DI), and which patterns you will use weekly versus once a year. The goal is not reverence — it is calibrated use.
The story
A staff engineer interviewing at a FAANG was asked to "implement Visitor." She paused and said: "In production Java I'd reach for pattern-matching switch expressions instead — Visitor exists because old Java lacked them. Want me to show both?" She got the offer. Knowing why a GoF pattern existed beats reciting its UML diagram. That is the GoF legacy in 2026: respect the intent, modernize the ceremony.
The business problem
Teams that treat GoF as either gospel or garbage both lose. The business cost shows up in how fast you ship and how safely you change:
- Interview friction: candidates memorize UML but cannot explain why Observer beats polling in event systems.
- Legacy navigation: Spring, JDK, and enterprise codebases speak GoF — engineers without vocabulary read them slowly.
- Over-engineering tax: juniors apply all 23 patterns to greenfield code; seniors spend reviews removing unnecessary abstractions.
- Under-engineering tax: teams dismiss patterns as "1990s OOP" and rebuild the same tangled conditionals GoF was written to prevent.
- The balance: GoF names compress design reviews — but only when paired with modern patterns (DI, Repository, CQRS) the book never included.
The problem teams faced
Before GoF, the software industry had no shared design vocabulary:
- The same solutions were rediscovered with different names in every team and language.
- Object-oriented design lacked language for trade-offs — reviews devolved into taste debates.
- Junior engineers had no map from "this code feels wrong" to "this is the documented fix."
- Design knowledge did not travel between C++, Smalltalk, Java, or later TypeScript and Rust.
Understanding the topic
The GoF catalog: 23 patterns in three families. Group by intent — not alphabet — and recognition becomes manageable:
- Creational (5) — how objects are born: Singleton, Factory Method, Abstract Factory, Builder, Prototype.
- Structural (7) — how objects are composed: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy.
- Behavioral (11) — how objects collaborate: Strategy, Observer, Command, State, Template Method, Iterator, Chain of Responsibility, Mediator, Memento, Visitor, Interpreter.
- Modern additions — DI, Repository, CQRS, Saga, Outbox, Circuit Breaker (Fowler, Evans, Hohpe — post-1994).
Internal architecture
Where GoF sits in your design toolkit today:
- GoF (1994): tactical OOP patterns — object creation, composition, collaboration within a process.
- PoEAA / Fowler: persistence patterns — Repository, Unit of Work, Service Layer.
- DDD (Evans): domain modeling — aggregates, bounded contexts, domain events.
- EIP (Hohpe): messaging patterns — Saga, Outbox, publish-subscribe at network scale.
GoF vocabulary + Modern DI/Repository/CQRS = Complete senior toolkit
Visual explanation
Three diagrams organize the GoF legacy for daily use. The first maps the catalog structure. The second shows how 1994 patterns translate to modern practice. The third separates patterns you will reach for weekly from those you learn on demand.
Informative example
GoF patterns in modern TypeScript — same intent, less ceremony. Here is how three weekly patterns look today:
// Strategy (Behavioral) — algorithm varies; inject a function or interfacetype PricingFn = (cart: Cart) => Money;const checkout = (price: PricingFn) => (cart: Cart) => charge(price(cart));// Factory Method (Creational) — subclass decides which product to createabstract class NotificationFactory {abstract create(): Notifier;send(msg: string) { this.create().deliver(msg); }}// Adapter (Structural) — legacy API wrapped to match your interfaceclass StripeAdapter implements PaymentGateway {constructor(private stripe: LegacyStripeSdk) {}charge(amount: Money) { return this.stripe.createCharge({ amount: amount.cents }); }}
Notice what changed since 1994: Strategy can be a function type. Factory Method still uses inheritance but pairs naturally with DI. Adapter is unchanged in spirit — wrapping legacy code never goes out of style. The intent is GoF; the syntax is yours.
Execution workflow
Learn the 23 names
Recognition is mandatory for interviews and reading legacy frameworks.
Real-world use
GoF names are embedded in every major framework. Spring exposes BeanFactory, ProxyFactoryBean, and TransactionTemplate. React documents Higher-Order Components (Decorator) and Render Props. Express middleware is Chain of Responsibility. RxJS operators combine Decorator and Observer. AWS SDK builders use Builder. Kafka consumer groups implement Iterator at scale. When you read framework source code, you are reading a GoF dictionary with modern spelling.
Production case study
A platform team ran a twelve-week GoF book club. Half the team called patterns "outdated"; the other half quoted them religiously. The tech lead changed the format:
- Exercise: map each of the 23 patterns to one real file in their own codebase.
- Label each: "use weekly," "use rarely," or "obsolete in our stack."
- Discovery: Strategy and Observer appeared in 40+ files; Visitor appeared zero times.
- Outcome: the shared list became the team's design dictionary; PR comment length dropped 25%.
- Lesson: GoF is a starting catalog, not a doctrine — calibrate to your stack and measure, do not debate.
Trade-offs
- Pro — Vocabulary: 23 names every senior engineer recognizes worldwide.
- Pro — Trade-off discipline: each pattern documents consequences, not just benefits.
- Pro — Cross-language portability: the structure survives translation to TypeScript, Kotlin, or Rust.
- Con — Dated samples: verbose C++/Smalltalk; some patterns feel heavy in modern languages.
- Con — Missing modern patterns: DI, Repository, CQRS, Saga, Outbox, Circuit Breaker postdate the book.
- Con — Over-engineering risk: beginners apply patterns to greenfield code where plain functions suffice.
Decision framework
- Use GoF as vocabulary when your team has three or more engineers writing shared code.
- Use GoF for interviews — pattern recognition is non-negotiable at senior levels.
- Use GoF for legacy — reading code from the 1990s–2000s requires knowing the names.
- Do not use GoF as a checklist — no project needs all 23 patterns.
- Do not copy verbatim — adapt every pattern to your language, DI container, and deployment model.
- Always pair with modern patterns — DI for testability, Repository for persistence, Saga for distributed transactions.
Best practices
- Master the top 8 weekly patterns before memorizing the remaining fifteen.
- When reading GoF, focus on Problem and Consequences — skim the C++ syntax.
- Maintain a team doc: pattern name → one example file in your repo → frequency label.
- In code review, say "this smells like Strategy" — not "we need a Strategy pattern here."
- Pair GoF study with Fowler's PoEAA for persistence patterns the book omitted.
- Retire abstractions when git history shows the variation never materialized.
Anti-patterns to avoid
- Implementing Visitor in TypeScript when pattern matching or discriminated unions solve the same problem.
- Singleton as a global variable in disguise — use DI scoped lifetime instead.
- Factory classes that wrap a single `new SomeClass()` with no variation axis.
- Treating the GoF book as mandatory reading for every pattern before shipping features.
Common mistakes
- Memorizing UML diagrams without understanding the force each pattern resolves.
- Assuming GoF patterns map 1:1 to microservices — most are in-process; Saga and Outbox are network-scale.
- Ignoring post-GoF patterns (DI, Repository) because they are "not in the book."
- Debating whether patterns are "still relevant" instead of mapping them to your codebase.
Debugging tips
- When framework behavior surprises you, search the source for GoF names — Proxy and Decorator hide in middleware stacks.
- If a "pattern" class has only one implementation after six months, delete it or document why.
- Compare your team's "weekly" list against git churn — patterns should correlate with change frequency.
- When onboarding, point new hires to named examples in the repo, not the textbook.
Optimization strategies
- Study creational patterns together — they all answer "who creates this object?"
- Study behavioral patterns in pairs — Strategy vs State, Observer vs Mediator solve overlapping forces differently.
- Use the book club mapping exercise as a one-time team investment — it pays back in every future review.
- For interviews, prepare one production story per weekly pattern — stories beat definitions.
Common misconceptions
- Many developers believe GoF patterns are obsolete. In reality, languages absorbed the ceremony but the forces — variation, composition, collaboration — are permanent.
- Many developers believe you must implement all 23. In reality, eight patterns cover most product engineering; the rest are situational.
- Many developers believe GoF is only for OOP. In reality, functional and reactive code uses the same vocabulary with different syntax.
- Related reading: PoEAA (Fowler) for persistence, EIP (Hohpe) for messaging, DDD (Evans) for strategic design.
Advanced interview questions
Interview Prep
Practice concise answers, then expand each card for the explanation.
1BeginnerQuestionWho are the Gang of Four and what did they publish?+
Answer
Follow-up
2IntermediateQuestionWhy are some GoF patterns rarely used today?+
Answer
Follow-up
3IntermediateQuestionWhich GoF patterns do you reach for most often?+
Answer
Follow-up
4BeginnerQuestionIs the GoF book still worth reading in 2026?+
Answer
Follow-up
5AdvancedQuestionName a modern pattern GoF should have included.+
Answer
Follow-up
Summary
You now understand the Gang of Four legacy: four authors, 23 patterns, three families, and three decades of industry vocabulary built on their work. You can map GoF intent to modern TypeScript, name your top eight weekly patterns, and explain why Visitor interviews are really tests of historical context. Teach the fintech staff-engineer story to a colleague — if you can do that, you own this lesson.