collection Commons
Private · saved on this device

GoF Design Patterns

All 23 Gang of Four patterns, with worked examples, illustrated collaborations, code, and deliberate tradeoffs.

These 23 patterns explore recurring designs for objects and their collaborations. Each article starts with a recognizable problem, explains the core mechanism, and develops concrete examples with syntax-highlighted code and explanatory illustrations. Applicability, costs, and neighboring designs help you decide whether the extra structure is worthwhile.

Browse the patterns alphabetically. The collection is a reference, so begin with the problem you are facing and follow comparisons between related designs.

Curated selection

In this Collection

23 entries · Author-defined order
  1. Software Engineering

    pattern · commons

    Abstract Factory

    Create families of compatible products through one coherent creation interface.

  2. Software Engineering

    pattern · commons

    Adapter

    Translate an existing interface into the contract a client expects.

  3. Software Engineering

    pattern · commons

    Bridge

    Separate an abstraction from its implementation so two dimensions can vary independently.

  4. Software Engineering

    pattern · commons

    Builder

    Separate staged construction of a complex result from the result itself.

  5. Software Engineering

    pattern · commons

    Chain of Responsibility

    Let a request pass through candidate handlers without coupling its sender to a specific receiver.

  6. Software Engineering

    pattern · commons

    Command

    Represent an operation as an object or value so it can be stored, scheduled, or composed.

  7. Software Engineering

    pattern · commons

    Composite

    Give individual objects and groups a common interface for recursive tree operations.

  8. Software Engineering

    pattern · commons

    Decorator

    Compose optional responsibilities by wrapping an object behind the same contract.

  9. Software Engineering

    pattern · commons

    Facade

    Offer a focused interface over a subsystem with several collaborating components.

  10. Software Engineering

    pattern · commons

    Factory Method

    Let a reusable workflow delegate object creation to an overridable method.

  11. Software Engineering

    pattern · commons

    Flyweight

    Share reusable intrinsic state while keeping context-specific state outside the shared object.

  12. Software Engineering

    pattern · commons

    Interpreter

    Model a small language through expression objects that evaluate its grammar.

  13. Software Engineering

    pattern · commons

    Iterator

    Traverse elements through a common protocol without exposing a collection’s representation.

  14. Software Engineering

    pattern · commons

    Mediator

    Place collaboration rules in a coordinator instead of spreading them across peer objects.

  15. Software Engineering

    pattern · commons

    Memento

    Capture restorable state without requiring the caretaker to inspect its internal representation.

  16. Software Engineering

    pattern · commons

    Observer

    Let subscribers receive notifications when a subject changes without hard-coding its dependents.

  17. Software Engineering

    pattern · commons

    Prototype

    Create a new object by copying an existing configured representative.

  18. Software Engineering

    pattern · commons

    Proxy

    Stand in for another object to mediate access while preserving its useful interface.

  19. Software Engineering

    pattern · commons

    Singleton

    Restrict a class to one instance within a defined scope and expose shared access to it.

  20. Software Engineering

    pattern · commons

    State

    Move state-dependent behavior into explicit state objects and delegate through the current state.