Tagged “Comparison”
5 articles with this tag.
- 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.
- 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).
- 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.