100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Software Design

The Gang of Four and Pattern Categories

How the 1994 Gang of Four catalog organized 23 object-oriented design patterns into Creational, Structural, and Behavioral categories, with representative examples of each.

FoundationsBeginner9 min readJul 10, 2026
Analogies

The Gang of Four and Pattern Categories

In 1994, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides — collectively nicknamed the 'Gang of Four' (GoF) — published Design Patterns: Elements of Reusable Object-Oriented Software. The book catalogued 23 patterns observed repeatedly in well-designed object-oriented systems written in C++ and Smalltalk, and organized them into three categories based on the kind of problem they solve: Creational (object creation), Structural (object composition), and Behavioral (object interaction and responsibility). This taxonomy remains the standard reference point three decades later, even as newer catalogs (enterprise, concurrency, cloud) have extended it.

🏏

Cricket analogy: The way the ICC organizes formats into Test, ODI, and T20 — each with a distinct rule set solving a different problem (depth vs. speed vs. spectacle) — mirrors how the GoF organized 23 patterns into three distinct problem categories.

Creational Patterns

Creational patterns abstract the process of object instantiation, so a system does not depend on the concrete classes it creates. The five GoF creational patterns are Singleton, Factory Method, Abstract Factory, Builder, and Prototype. Factory Method lets a subclass decide which concrete class to instantiate; Abstract Factory produces families of related objects (for example, a UI toolkit that creates matching buttons, checkboxes, and scrollbars for either Windows or macOS); Builder separates the construction of a complex object from its representation, useful when an object has many optional parameters.

🏏

Cricket analogy: A franchise's scouting department deciding which type of player to sign — pace bowler, spinner, or all-rounder — based on the pitch conditions of the venue is exactly the decision-deferral that Factory Method encapsulates for object creation.

java
// Factory Method: defer instantiation to a subclass
interface Notification { void send(String message); }

class EmailNotification implements Notification {
    public void send(String message) { System.out.println("Email: " + message); }
}
class SmsNotification implements Notification {
    public void send(String message) { System.out.println("SMS: " + message); }
}

abstract class NotifierCreator {
    abstract Notification createNotification();
    void notifyUser(String message) {
        Notification n = createNotification();  // subclass decides the concrete class
        n.send(message);
    }
}

class EmailNotifierCreator extends NotifierCreator {
    Notification createNotification() { return new EmailNotification(); }
}

Structural and Behavioral Patterns

Structural patterns (seven in the GoF catalog: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy) deal with how classes and objects are composed to form larger structures while keeping them flexible and efficient — for instance, Adapter lets an incompatible interface work with existing client code, and Decorator attaches new responsibilities to an object dynamically without subclassing. Behavioral patterns (eleven: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor) address how objects communicate and distribute responsibility, such as Observer notifying dependents of state changes or Strategy encapsulating interchangeable algorithms behind a common interface.

🏏

Cricket analogy: A cricket commentator translating on-field hand signals from the third umpire into spoken language for TV viewers is an Adapter, converting one interface (visual signals) into another (audio commentary) the audience can consume.

A quick mnemonic: Creational patterns answer 'how is this object made?', Structural patterns answer 'how do these objects fit together?', and Behavioral patterns answer 'how do these objects talk to each other and share responsibility?'

Not every pattern you'll encounter in the wild is from the original 23. Later catalogs added patterns like Dependency Injection, Repository, and Circuit Breaker for enterprise and distributed systems — useful, but distinct from the GoF's original object-oriented taxonomy.

  • The Gang of Four (Gamma, Helm, Johnson, Vlissides) published the seminal 1994 patterns catalog.
  • The GoF catalog contains 23 patterns split into three categories: Creational, Structural, Behavioral.
  • Creational patterns (5): Singleton, Factory Method, Abstract Factory, Builder, Prototype — they abstract object instantiation.
  • Structural patterns (7): Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy — they govern how objects compose.
  • Behavioral patterns (11): Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor — they govern object interaction.
  • The mnemonic is: Creational = how it's made, Structural = how it fits together, Behavioral = how it communicates.
  • Later catalogs (enterprise, cloud, concurrency patterns) extend but are distinct from the original GoF taxonomy.

Practice what you learned

Was this page helpful?

Topics covered

#SoftwareDesign#DesignPatternsStudyNotes#SoftwareEngineering#TheGangOfFourAndPatternCategories#Gang#Four#Pattern#Categories#StudyNotes#SkillVeris