The Pattern Map
The Pattern Map: GoF to Cloud to AI
October 5, 2026 · 9 min read
Design Patterns, Software Architecture, AI, Cloud, C#, Python
Last year I wrote up five design patterns every developer should master, a Factory vs Strategy explainer, and a personal reference of the patterns I keep coming back to. That covered five of the 23 Gang of Four patterns. This series covers the other eighteen, then follows the family tree forward.
The reason I'm doing it now: I spend most of my day building iOS, Android and Mac apps with an AI coding agent beside me, and the AI tooling keeps reinventing patterns I first learned in C#. An MCP server is an Adapter. A model router is a Strategy. A guardrail pipeline is a Chain of Responsibility. A tool call is a Command. The names are new; the ideas aren't.
So this post is the map. It lists every pattern, groups them, and for the cloud and AI ones, names the older pattern they descend from. Links appear as posts go live. Everything not yet linked is planned, with a date.
How to read the map
- GoF is the 1994 Design Patterns book by Gamma, Helm, Johnson and Vlissides. Its 23 patterns are about objects inside one process.
- Cloud patterns are the same problems once the objects are on different machines and the network can fail. I'm using the names from Microsoft's Azure Architecture Center catalog because that's where I learned them, but they're technology-agnostic.
- AI era patterns are what happens when one of the "objects" is a language model: non-deterministic, slow, billed per token, and sometimes wrong.
- The "ancestor" column is my mapping, not an official one. Some are exact (MCP really is an Adapter). Some are loose, and I say so.
Every pattern post follows the same shape: the problem it solves, a small realistic example in C# and Python (Swift too where it fits, since that's most of what I write now), a note on when Python makes the pattern unnecessary, and one line on where you'll see it in the cloud and AI era.
Gang of Four: creational
How objects get made.
| Pattern | One line | Post |
|---|---|---|
| Factory Method | Let a method decide which concrete class to create | 5 patterns, Factory vs Strategy |
| Singleton | Exactly one instance, shared | 5 patterns |
| Abstract Factory | Create whole families of objects that must match | Creational patterns |
| Builder | Assemble a complex object step by step, validate once | Creational patterns |
| Prototype | Make new objects by copying a configured one | Creational patterns |
Gang of Four: structural
How objects fit together.
| Pattern | One line | Post |
|---|---|---|
| Decorator | Wrap an object to add behaviour, same interface | 5 patterns |
| Adapter | Make an interface you have fit the one you need | Adapter, Facade, Proxy |
| Facade | One simple front door to a complicated subsystem | Adapter, Facade, Proxy |
| Proxy | A stand-in that controls access to the real thing | Adapter, Facade, Proxy |
| Composite | Treat a tree of objects and a single object the same way | Composite, Bridge, Flyweight |
| Bridge | Split an abstraction from its implementation so both can vary | Composite, Bridge, Flyweight |
| Flyweight | Share the common state of many small objects | Composite, Bridge, Flyweight |
Gang of Four: behavioral
How objects talk and divide up work.
| Pattern | One line | Post |
|---|---|---|
| Observer | Notify subscribers when something changes | 5 patterns |
| Strategy | Swap an algorithm at runtime | 5 patterns, Factory vs Strategy |
| Command | Turn a request into an object you can queue, log or undo | Behavioral I |
| Chain of Responsibility | Pass a request along handlers until one deals with it | Behavioral I |
| Mediator | Objects talk through a hub instead of to each other | Behavioral I |
| Template Method | Fixed algorithm skeleton, overridable steps | Behavioral I |
| State | Behaviour changes with internal state, without a giant switch | Behavioral II |
| Iterator | Walk a collection without knowing how it's stored | Behavioral II |
| Memento | Snapshot state so you can restore it later | Behavioral II |
| Visitor | Add operations to a class hierarchy without editing it | Behavioral II |
| Interpreter | Represent a small language's grammar as objects | Behavioral II |
That's 23.
Cloud patterns
These are the GoF ideas after the objects moved onto different machines. I've grouped them into three planned posts; which pattern lands in which post may shift as I write them.
| Pattern | Ancestor | Why |
|---|---|---|
| Retry | Proxy / Decorator | A wrapper with the same interface that re-invokes the real call |
| Circuit Breaker | State + Proxy | A proxy whose behaviour depends on closed, open and half-open states |
| Bulkhead | (none in GoF) | Isolation of resource pools; a ship-design idea more than an object one |
| Rate Limiting / Throttling | Proxy | Controls access to the real subject |
| Health Endpoint Monitoring | Observer, loosely | Something outside watches and reacts |
My first pass at Retry and Circuit Breaker, with Polly, is in Design Patterns I Keep Coming Back To.
| Pattern | Ancestor | Why |
|---|---|---|
| Publisher-Subscriber | Observer | Observer across a network, with a broker in the middle |
| Competing Consumers | (none in GoF) | Many workers, one queue |
| Queue-Based Load Leveling | Command | Requests become queued objects |
| Event Sourcing | Command + Memento | Store the commands (events), rebuild state from them |
| CQRS | (none in GoF) | Separate read and write models |
| Saga / Compensating Transaction | Command, with undo | Each step knows how to reverse itself |
| Transactional Outbox | (none in GoF) | Save and publish atomically |
| Claim Check | Proxy, loosely | Send a reference instead of the payload |
I covered the event-sourcing side of this at length in a five-part series last year: the honest truth, Azure building blocks, saga orchestration, sagas with Durable Functions and key concepts. The messaging post will link back rather than repeat it.
| Pattern | Ancestor | Why |
|---|---|---|
| Anti-Corruption Layer | Adapter / Facade | Microsoft's own description is "a façade or adapter layer" |
| Gateway Routing | Proxy + Strategy | One endpoint, routing decides where the call goes |
| Gateway Aggregation | Facade | One request fans out to several services |
| Backends for Frontends | Facade | One facade per client type |
| Ambassador | Proxy | A helper that makes network calls on your behalf |
| Sidecar | Decorator | Adds behaviour beside the app without changing it |
| Strangler Fig | Proxy | A front that routes, piece by piece, from old to new |
AI-era patterns, coming early 2027
These are the ones I'll write last, once I've built enough agents that the code in them is real rather than illustrative.
| AI-era pattern | Ancestor | How close |
|---|---|---|
| MCP server | Adapter | Exact. It adapts a tool or data source to one common protocol |
| Tool call | Command | Exact. A request as data: name plus arguments, which can be logged, approved, retried |
| Model router | Strategy | Exact. Pick the model per request: cheap for easy, strong for hard |
| Guardrails pipeline | Chain of Responsibility | Close. Each check can pass, modify or stop the request |
| LLM gateway (caching, keys, rate limits) | Proxy | Exact |
RAG ask() | Facade | Exact. Retrieval, prompt assembly, model call and citations behind one function |
| Subagent spawned from a base config | Prototype | Close, and the deep-copy bugs are the same |
| Conversation checkpoints and rewind | Memento | Close |
| Streaming tokens | Iterator / Observer | Close |
| Agent loop | State | Loose. "Thinking, calling a tool, waiting for approval, done" |
Anthropic's Building effective agents post (December 2024) gave names to five workflow patterns that I'll use as the backbone of the AI posts:
| Workflow | Ancestor | How close |
|---|---|---|
| Prompt chaining | Pipes and Filters | Close. Each step feeds the next; unlike Chain of Responsibility, every step runs |
| Routing | Strategy | Exact |
| Parallelization | (none in GoF) | Fan-out and gather; the cloud cousin is Gateway Aggregation |
| Orchestrator-workers | Mediator | Close. The orchestrator decides who does what; workers don't talk to each other |
| Evaluator-optimizer | (none in GoF) | A generate-and-judge loop; Strategy for the judge, at most |
I wrote about MCP itself in January in Understanding MCP, and about a bare agent loop and its tool calls in I Built a 300-Line Coding Agent for Local Models. The AI-era posts will build on both.
Why bother mapping it
Two reasons, both practical.
First, it shortens learning. When a new AI framework announces a "router" or a "guardrail", I don't need to learn a new concept, just a new API for an old one. The questions I already know to ask about Strategy (who picks, when, can I test each option alone?) are the right questions about model routing.
Second, it carries the old warnings forward. Every GoF pattern came with a list of ways it goes wrong. A Proxy that silently caches can serve stale data; so can an LLM gateway. A shallow-copied Prototype leaks changes back into the original; so does a subagent config that shares a tool list with its parent. The bugs migrate with the pattern.
Further reading
- Design Patterns: Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnson and Vlissides (Addison-Wesley, 1994), the original 23.
- Refactoring.Guru's design pattern catalog, a free, well-illustrated walkthrough of all 23 GoF patterns.
- Microsoft's cloud design patterns catalog in the Azure Architecture Center.
- Anthropic's engineering post on building effective agents, for the workflow names.
- Model Context Protocol introduction.
Thoughts on this?
Tell me on X: @bobbyencoded · Share this post on X
Want more like this? Subscribe to The Decode, a weekly email on the AI and developer news worth your time.