Comparisons
Side-by-side comparisons of patterns and architecture styles that are often confused.
Many patterns share the same class structure and differ only in intent. Comparison pages put the candidates side by side, state the deciding question, and link to the full articles.
Published pattern comparisons: Adapter vs Decorator vs Proxy vs Facade, Factory patterns compared, Strategy vs State vs Template Method Observer vs Mediator vs Event Bus and REST vs GraphQL vs gRPC vs Messaging. Choreography versus orchestration is compared in the Saga Pattern. Architecture-style comparisons currently live in Layered versus Hexagonal Architecture and Microservices versus Modular Monolith.
Articles
- Adapter vs Decorator vs Proxy vs FacadeFour structural patterns that all wrap other objects. The one question that tells them apart, side-by-side Java sketches, and how to answer the classic interview question.
- Factory Patterns ComparedSimple factory, static factory method, GoF Factory Method, Abstract Factory and Builder — what each one is, how they differ, and which to choose.
- Strategy vs State vs Template MethodThree patterns that all vary behaviour: Strategy swaps a whole algorithm by composition, State swaps behaviour as an object's lifecycle changes, and Template Method varies steps by inheritance. Side-by-side code, the deciding questions and how to choose.
- Observer vs Mediator vs Event BusThree ways for objects to communicate without direct calls: Observer broadcasts from a subject to its listeners, Mediator centralises coordination logic, and an event bus decouples publishers and subscribers completely. Coupling, control flow, failure handling and how each scales to messaging and sagas.
- REST vs GraphQL vs gRPC vs messagingChoosing an API style: resource-oriented REST over HTTP, client-shaped GraphQL queries, contract-first gRPC with Protocol Buffers over HTTP/2, and asynchronous messaging — how each works, performance, coupling, caching, streaming, versioning, tooling, browser support, and when to use which (often several in one system).
Planned topics
These topics are on the roadmap and not written yet. They appear here so you can see the full scope of the section.
- Command versus Strategy
- Layered versus Hexagonal versus Clean versus Onion Architecture