Design patterns

Once by the book.
Once in production.

A pattern as the literature describes it, then the shape it takes in a real system. See what changes, why it changes, and when to reach for it — from creating a value to coordinating a set of collaborators.

Moving in. 69 of 73 topics have lessons; they're moving over from the old site.

73 topics

Moving in 69 of 73 topics have lessons, which are moving over from the old site. Planned topics show where the catalog is going.

Creation and lifecycle

Making things, keeping them valid, and deciding how long they live.

Composition and interfaces

What wraps what, and where one interface meets another.

Behavior and collaboration

Who talks to whom, who makes the decision, and who owns the work.

Application patterns

Reusable arrangements at the seams of an application.

Choice moving

Repository pattern & its critics

Put a boundary around persistence, and decide when the extra abstraction helps

TypeScriptGo

Selection, creation, and lifecycle

Compositions about choosing behavior, creating instances, and managing their lifetime.

Combination moving

Factory + Strategy

A factory selects or creates a strategy; the strategy supplies interchangeable behavior.

TypeScriptGo
Combination planned

Factory Method + Strategy

An overridable creation hook supplies a strategy object. A standalone lesson needs an ownership or lifecycle decision beyond Factory + Strategy and Factory Method + Template Method.

Combination moving

Factory Method + Template Method

A fixed workflow calls a creation hook that subclasses vary. Teach the pattern gap before the pairing.

TypeScriptGo
Combination moving

Registry + Strategy

A registry discovers named strategies; callers invoke them through one stable contract.

TypeScriptGo
Combination moving

Registry + Factory

A registry resolves a named provider; the provider creates an instance with a separate lifetime.

TypeScriptGo
Combination moving

Prototype + Registry

A registry finds a configured prototype to clone and customize, with copy depth made explicit.

TypeScriptGo
Combination moving

Abstract Factory + Strategy

An abstract factory supplies a compatible product family while a strategy varies behavior independently.

TypeScriptGo
Combination moving

Bridge + Abstract Factory

An abstract factory supplies a compatible playback backend and timestamp index; a bridge keeps the listening session independent of the backend.

TypeScriptGo
Combination moving

Factory + Object Pool

A factory creates schema-configured instances on pool demand while the pool owns capacity, leases, return, reset, and retirement.

TypeScriptGo
Combination moving

Multiton + Lazy Initialization

A shift-scoped owner lazily retains one sample history per buoy; removal starts a new generation while held histories remain usable.

TypeScriptGo
Combination moving

Lazy Initialization + Proxy

A permission-checking proxy constructs a design-review preview renderer on first allowed use and defines sequential failure retry.

TypeScriptGo
Combination moving

Abstract Factory + Builder

An abstract factory selects a compatible product family; a builder assembles one valid result from it.

TypeScriptGo
Combination planned

Singleton + Lazy Initialization

One owner creates its shared instance on first demand, with scope and initialization failure made explicit.

Combination moving

Registry + Abstract Factory

A registry selects a named product family; the abstract factory creates compatible products within it.

TypeScriptGo

Trees, expressions, and construction

Compositions about building nested structures and adding operations over them.

Combination moving

Composite + Iterator

Composite owns the tree; an iterator controls traversal order and demand.

TypeScriptGo
Combination moving

Composite + Visitor

Composite owns stable structure while visitors add operations over its node types.

TypeScriptGo
Combination moving

Composite + Interpreter

Composite supplies expression-tree shape; an interpreter evaluates nodes against fresh context.

TypeScriptGo
Combination moving

Interpreter + Visitor

An interpreter evaluates a supplied group-booking rule tree; visitors add independent policy-printing and fact-inventory operations over its stable nodes.

TypeScriptGo
Combination moving

Composite + Flyweight

A nested quilt keeps every patch occurrence distinct while sharing canonical immutable fabric descriptions.

TypeScriptGo
Combination moving

Builder + Composite

A builder publishes a validated cloud capability catalog; Composite provides ordered leaves and subtree counts.

TypeScriptGo
Combination moving

Builder + Prototype

A builder starts from a configured prototype copy, with retained references and copy depth explicit.

TypeScriptGo
Combination moving

Composite + Decorator

Decorators add behavior to individual tree nodes while preserving the component contract and traversal rules.

TypeScriptGo
Combination moving

Composite + Proxy

A composite keeps one whole/part query while independent branch proxies retain acquired targets and preserve captured generation identity.

TypeScriptGo
Combination moving

Iterator + Visitor

An iterator controls traversal order and demand; a visitor performs an operation at each node.

TypeScriptGo
Combination moving

Command + Interpreter

An interpreter prepares inert commands from a saved description; a separate invoker authorizes the whole batch and reports an honest applied prefix.

TypeScriptGo

Behavior, dispatch, and history

Compositions about routing work, accepting transitions, and preserving or reporting outcomes.

Combination moving

Decorator + Strategy

A strategy supplies behavior while decorators wrap its contract; order and failure propagation stay visible.

TypeScriptGo
Combination moving

Chain of responsibility + Command

Commands package requests; a chain decides which handler claims each one.

TypeScriptGo
Combination moving

Command + Memento

Commands represent actions while mementos capture restorable state, apart from external side effects.

TypeScriptGo
Combination moving

Command + Observer

A command commits a weekly-box preference before direct observers receive the immutable result.

TypeScriptGo
Combination moving

State machine + Command

A state machine accepts a transition before commands carry out its effects.

TypeScriptGo
Combination moving

State machine + Observer

The owner retains accepted transition facts for returning observers while current state and live readers continue.

TypeScriptGo
Combination moving

State machine + Memento

A state machine guards restoration of saved phase and prerequisite data while external receipts stay current.

TypeScriptGo
Combination moving

Mediator + Observer

A mediator commits joint participant decisions before optional observers receive detached outcome facts.

TypeScriptGo
Combination planned

Null Object + Strategy

A no-op strategy represents deliberate optional behavior, distinct from a missing or failed strategy.

Combination planned

Template Method + Strategy

Template Method fixes the workflow while a strategy supplies a replaceable policy for one step.

Combination moving

Chain of responsibility + Decorator

An ordered handler chain controls progression and short-circuiting; a Decorator records each outcome without changing it.

TypeScriptGo
Combination moving

Command + Publish / subscribe

Commands commit requested changes before outcome facts enter independent subscriber inboxes for processing and retry.

TypeScriptGo
Combination moving

State machine + Strategy

A state owner grants permission, invokes an independently selected calculation policy, and validates its candidate before retaining an accepted record.

TypeScriptGo

Integration and boundaries

Compositions about translating interfaces, coordinating subsystems, and guarding shared results.

Combination moving

Adapter + Facade

Adapters translate individual interfaces; a facade coordinates a simpler subsystem workflow.

TypeScriptGo
Combination moving

Adapter + Repository

A repository keeps application persistence policy stable while adapters translate native records, units and conditional write protocols.

TypeScriptGo
Combination moving

Adapter + Decorator

Adapters normalize foreign replies; decorators apply independent request and result policies around the stable application contract.

TypeScriptGo
Combination moving

Adapter + Proxy

An adapter validates a complete canonical artifact before a proxy retains it under current access and application identity.

TypeScriptGo