Facade
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
The Problem
Using a complex subsystem directly requires knowing dozens of classes, their initialization order, and their interdependencies. Client code becomes tightly coupled to implementation details. Every new caller must repeat the same orchestration boilerplate.
Structure
Execution Walkthrough
Complex subsystem
EventScheduler, BarrierSync, Profiler, ResultWriter — each has its own API and must be used in the right order.
Facade owns them
One entry point
Orchestration
Client simplicity
Code Comparison
Full C++ Implementation
Participants
Where it is used
Compiler front-ends
clang::CompilerInstance drives lexer, parser, sema, codegen, and diagnostics via one object.
OpenGL / Vulkan
GLFW/GLEW hide 50+ platform-specific calls needed to open a window and get a rendering context.
OS system calls
POSIX stdio (fopen/fread/fclose) is a Facade over open/read/close/lseek with hidden buffering.
Simulation engines
SimEngine::run_all() drives event scheduling, barrier sync, profiler, and serialization behind one call.