›bobbyencoded_
/posts/newsletter/courses/about
/posts/newsletter/courses/about

The Decode

The week's AI & software news, decoded.

Subscribe →

// © 2026 BobbyEncoded Inc. — A Canadian corporation

← Back to Blog

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.

PatternOne linePost
Factory MethodLet a method decide which concrete class to create5 patterns, Factory vs Strategy
SingletonExactly one instance, shared5 patterns
Abstract FactoryCreate whole families of objects that must matchCreational patterns
BuilderAssemble a complex object step by step, validate onceCreational patterns
PrototypeMake new objects by copying a configured oneCreational patterns

Gang of Four: structural

How objects fit together.

PatternOne linePost
DecoratorWrap an object to add behaviour, same interface5 patterns
AdapterMake an interface you have fit the one you needAdapter, Facade, Proxy
FacadeOne simple front door to a complicated subsystemAdapter, Facade, Proxy
ProxyA stand-in that controls access to the real thingAdapter, Facade, Proxy
CompositeTreat a tree of objects and a single object the same wayComposite, Bridge, Flyweight
BridgeSplit an abstraction from its implementation so both can varyComposite, Bridge, Flyweight
FlyweightShare the common state of many small objectsComposite, Bridge, Flyweight

Gang of Four: behavioral

How objects talk and divide up work.

PatternOne linePost
ObserverNotify subscribers when something changes5 patterns
StrategySwap an algorithm at runtime5 patterns, Factory vs Strategy
CommandTurn a request into an object you can queue, log or undoBehavioral I
Chain of ResponsibilityPass a request along handlers until one deals with itBehavioral I
MediatorObjects talk through a hub instead of to each otherBehavioral I
Template MethodFixed algorithm skeleton, overridable stepsBehavioral I
StateBehaviour changes with internal state, without a giant switchBehavioral II
IteratorWalk a collection without knowing how it's storedBehavioral II
MementoSnapshot state so you can restore it laterBehavioral II
VisitorAdd operations to a class hierarchy without editing itBehavioral II
InterpreterRepresent a small language's grammar as objectsBehavioral 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.

Resilience

PatternAncestorWhy
RetryProxy / DecoratorA wrapper with the same interface that re-invokes the real call
Circuit BreakerState + ProxyA 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 / ThrottlingProxyControls access to the real subject
Health Endpoint MonitoringObserver, looselySomething outside watches and reacts

My first pass at Retry and Circuit Breaker, with Polly, is in Design Patterns I Keep Coming Back To.

Messaging

PatternAncestorWhy
Publisher-SubscriberObserverObserver across a network, with a broker in the middle
Competing Consumers(none in GoF)Many workers, one queue
Queue-Based Load LevelingCommandRequests become queued objects
Event SourcingCommand + MementoStore the commands (events), rebuild state from them
CQRS(none in GoF)Separate read and write models
Saga / Compensating TransactionCommand, with undoEach step knows how to reverse itself
Transactional Outbox(none in GoF)Save and publish atomically
Claim CheckProxy, looselySend 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.

Structure and migration

PatternAncestorWhy
Anti-Corruption LayerAdapter / FacadeMicrosoft's own description is "a façade or adapter layer"
Gateway RoutingProxy + StrategyOne endpoint, routing decides where the call goes
Gateway AggregationFacadeOne request fans out to several services
Backends for FrontendsFacadeOne facade per client type
AmbassadorProxyA helper that makes network calls on your behalf
SidecarDecoratorAdds behaviour beside the app without changing it
Strangler FigProxyA 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 patternAncestorHow close
MCP serverAdapterExact. It adapts a tool or data source to one common protocol
Tool callCommandExact. A request as data: name plus arguments, which can be logged, approved, retried
Model routerStrategyExact. Pick the model per request: cheap for easy, strong for hard
Guardrails pipelineChain of ResponsibilityClose. Each check can pass, modify or stop the request
LLM gateway (caching, keys, rate limits)ProxyExact
RAG ask()FacadeExact. Retrieval, prompt assembly, model call and citations behind one function
Subagent spawned from a base configPrototypeClose, and the deep-copy bugs are the same
Conversation checkpoints and rewindMementoClose
Streaming tokensIterator / ObserverClose
Agent loopStateLoose. "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:

WorkflowAncestorHow close
Prompt chainingPipes and FiltersClose. Each step feeds the next; unlike Chain of Responsibility, every step runs
RoutingStrategyExact
Parallelization(none in GoF)Fan-out and gather; the cloud cousin is Gateway Aggregation
Orchestrator-workersMediatorClose. 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.
← Previous

How Services Talk: API Gateway, BFF, Pub/Sub, Event-Driven and Rate Limiting in Practice

Next →

Screen and App Architecture: MVVM, Unidirectional Data Flow and Offline-First, with Runnable Code

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.