liveBook · Manning

Facade pattern

As explained in Fast by Default

The facade pattern provides a simplified interface to a complex subsystem or set of underlying components.

The facade pattern provides a simplified client interface over complex or constrained services. It improves the experienced response without requiring changes to underlying systems, making it useful for legacy architectures and third-party APIs. section 5.5.1 section 5.0

A performance-oriented facade can:

  • Cache responses so repeated client requests avoid unnecessary calls to slow services. section 5.5.1
  • Extract only the fields required by the user interface instead of forwarding oversized responses. section 5.5.1
  • Orchestrate and parallelize calls across multiple underlying services while presenting one combined response. section 5.5.1

Shipping-status facade

An e-commerce client needs only a shipment’s current status, but the shipping provider returns full shipment history. A facade can cache provider responses, select the required status fields, and parallelize rate checks across carriers while leaving the provider APIs unchanged. section 5.5.1

How Fast by Default covers it

How deep it goes
Explains caching, response shaping, orchestration, and parallelization, but stops short of implementation code or detailed interface design.
Examples
Uses an e-commerce shipping integration that filters shipment history, caches responses, and checks carrier rates in parallel.
What it assumes
Assumes an existing client-service architecture and distinguishes control of the client from control of the underlying server.
What you can do after
Apply it via a facade that shields clients from service complexity while improving response efficiency without changing providers.
How it connects
Connects facades with API aggregation, caching, parallelization, legacy systems, and third-party APIs.

Also explained in

Compare how 4 books explain facade pattern →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast by Default. The section links point to the parts of the book it draws on.