A design pattern that exposes a convenient interface in one place to provide access to a nested, complex object hierarchy.
In pseudo-code, a façade offers
aFacade.doSomething() where you’d otherwise have to call
On top of its responsibility to provide a 1:1 façade for an object hierarchy, it can also provide a more convenient API. For example, the façade can expose a single method while you’d otherwise have to call 2+ methods on different objects behind the façade. In that way, it overlaps with the Adapter pattern by adapting the original API and its convoluted accessors to your code base’s needs, exposing a single function instead.
|A façade to a hierarchy of entities is called Aggregate Root in [[ddd||Domain-Driven Design]].|