creational
Facade
Provide a simplified, unified interface to a complex subsystem.
A capable subsystem is often a tangle of classes with intricate interactions — decoders, buffers, codecs, mixers — and forcing every caller to learn and orchestrate that machinery spreads subsystem knowledge throughout your codebase. Now a change deep inside the subsystem ripples out to every client. Facade introduces a single, high-level entry point that handles the common cases so callers don't have to.
A hotel concierge — you ask to book a restaurant and taxi. The concierge handles the coordination.
Key Concepts
1
The Facade class exposes a small set of coarse-grained methods that read like the intentions of the caller — convert(file, format) rather than a dozen wiring calls. Internally it instantiates and coordinates the subsystem classes in the right order. The subsystem itself is untouched and still directly accessible, so advanced users who need fine control can bypass the facade; everyone else gets a clean, stable surface. The facade also acts as a seam: as long as its signature holds, the subsystem behind it can be refactored freely.
convert(file, format)
2
It fits whenever you want to wrap a complex library or legacy system, offer a simple API over a multi-step workflow, or define a clean boundary between layers of an application. The risk is the facade quietly turning into a god object that accumulates every conceivable convenience method until it is as complex as the thing it was meant to hide. Keep it focused on the genuinely common workflows, and let callers with unusual needs reach past it to the subsystem.