Home

/

The Production-Ready Playbook

/

The Pattern Quick-Reference Card

The Pattern Quick-Reference Card

Appendix A
Appendix
4
min read

This is the whole ladder on one card. Each row is a pattern you met in Part II, compressed to the three things you need at a glance: the problem it answers, the shape it takes in code or config, and the honest signal to skip it. The skip-if column is the one most reference cards omit and the one a small team reads first. Every pattern you adopt is one you maintain forever, so read down the skip-if column before you reach for anything.

The attributions stay in the per-altitude chapters and in Appendix C. The chapters carry the worked snippets; this card carries the shape in a phrase. When two disagree, trust the chapter.

The ladder of seven altitudes

Altitude 1 — Object

The code-level vocabulary, mostly from the Gang of Four, with a value object (Money) and a null object reaching just past the catalogue. These organise behaviour inside a single boundary. The shapes are plain C#, no library required.

PatternWhat it solvesThe shapeSkip-if
StrategySwap an algorithm or behaviour at runtimeAn interface with interchangeable implementations, chosen by the caller (CourierMatchingStrategy: nearest, fastest, cheapest)Only one implementation will ever exist
AdapterMake an incompatible interface fit yoursA wrapper that translates a third-party SDK to your own seam (the payment provider)You control both sides of the interface
DecoratorAdd behaviour without subclassingA wrapper implementing the same interface, layering surge, promo or loyalty on a base priceDI interception already does it
CommandEncapsulate an action as an objectA request as data you can queue, retry, undo or audit (place, cancel, add-to-cart)A direct method call is all you need
StateMake behaviour follow an explicit lifecycleA state object per status, each owning its allowed transitions (the Order lifecycle, placed through delivered)Two states, one transition: use a bool
ProxyControl access to the real objectA stand-in for lazy loading, access control, caching or a remote call (the lazy-loaded menu image)No access, laziness or remoting concern
CompositeTreat a tree and its parts through one interfaceA recursive structure where a node and a leaf share a type (the menu tree: sections, items, modifier groups)The data is flat, never nested
MoneyCarry an amount and its currency as one valueAn immutable value type owning cents, currency, and the one rounding rule; adding different currencies throwsA genuinely single-currency app that rounds in one place
Null ObjectKill scattered null checks for an optional collaboratorA do-nothing implementation of the interface (a silent NullNotifier), selected like any otherAbsence that means something the caller must handle

Honorable mentions: Factory Method (DI absorbs most creation), Facade, Template Method, Chain of Responsibility.

Altitude 2 — Component (structuring one service)

How a single service stays testable and changeable. Dependency Injection is the spine; the rest keep the domain core away from I/O.

PatternWhat it solvesThe shapeSkip-if
Dependency InjectionInject collaborators instead of newing them upConstructor parameters resolved by MS.Ext.DI with explicit lifetimesA one-file script
Data Gateway (+ stored procs)Own a table's SQL in one thin object, no ORM magicA focused class calling Dapper over stored procedures behind an interfaceA genuine throwaway prototype
Ports & Adapters (Hexagonal)Insulate the domain core from I/ODomain logic depending on interfaces; adapters at the edge wire the DB and networkTiny CRUD: plain layering is cheaper
Pipeline / MiddlewareCompose cross-cutting concerns per requestAn ordered chain handling auth, logging and validation before the handlerNo cross-cutting concerns yet
Mediator (command/query split)Decouple a request from its handlerOne handler per use-case, dispatched through a mediator; thin controllersA three-endpoint service
Anti-Corruption LayerKeep a messy external model out of yoursA translation boundary that maps a third party's model to your domainNo external system, or one you fully control
Domain EventsDecouple in-process side effects from the coreAn event raised on a change; handlers react (email, audit, projection)One straightforward side effect: just call it
SpecificationReuse one business rule across query, validation and UIA rule object with IsSatisfiedBy; And/Or/Not compose as a Composite ("open and in range")The rule only ever runs as one SQL query: write the predicate

Honorable mentions: Result/ErrorOr error handling, plain Layered architecture. (Worked over-engineering example for this altitude: heavy ORM / EF.)

the-pareto-stack-cloud-design-patterns-for-small-teams
the-ladder-of-altitudes
how-to-read-this
object-level-the-patterns-that-earn-their-keep
decorator
state
component-level-structuring-one-service
ports-and-adapters-hexagonal
mediator-the-commandquery-split
data-persistence
optimistic-concurrency
messaging-scale
outbox
resilience-staying-up-when-dependencies-dont
rate-limiting-throttling
timeout-fallback
the-composed-pipeline
observability-diagnostics-seeing-inside-production
metrics-the-four-golden-signals
externalised-configuration
hosting-cloud-agnostic-by-default
sidecar-ambassador
orchestrator-agnostic-deploy
a-reference-service
the-relay-outbox-to-queue
the-payment-saga-charge-pay-out-compensate
the-over-engineering-tax
conclusion-production-ready-deliberately
the-pattern-quick-reference-card
altitude-3-data-persistence
altitude-5-resilience
the-skip-list
full-event-sourcing-for-crud
robert-c-martin-uncle-bob-the-house-authority-for-structure
altitude-2-component
altitude-4-messaging-scale
altitude-6-observability-diagnostics

Download the full PDF for free?

Free download — no account required

Get the PDF
Get the PDF
Related Chapters
Free Download
Get the full PDF
All pages, including all code examples, diagrams, and the appendix reference card.
No spam. Unsubscribe at any time.
Your email won't be shared.
Oops! There's a problem with your request. We're working on fixing it. Please try again later.