Gang of Four · Visual Reference

Design Patterns

Animated structure diagrams, C++ examples, and real-world usage in simulators, compilers, and systems software.

Behavioral

Observer

4p

One state change, many listeners notified automatically.

View diagram →

Strategy

4p

Swap algorithms at runtime without changing the caller.

View diagram →

Command

4p

Wrap requests as objects — queue, log, and undo them.

View diagram →

Visitor

5p

Add operations to objects without modifying their classes.

View diagram →
Creational

Factory Method

4p

Let subclasses decide which class to instantiate.

View diagram →

Builder

4p

Construct complex objects step by step.

View diagram →

Singleton

1p

Exactly one instance, globally accessible.

View diagram →
Structural

Decorator

4p

Wrap an object to add behavior without subclassing.

View diagram →

Adapter

4p

Make incompatible interfaces work together.

View diagram →

Facade

4p

One clean interface over a complex subsystem.

View diagram →