Facade
The term “facade” used in the context of a design pattern takes inspiration from building architecture. In architecture, a facade refers to the appealing front of a building, which often looks more attractive than the rest of the structure. In programming, facades are like helpers that hide the complex inner workings of an implementation.
The Facade design pattern itself aims to offer a more user-friendly and straightforward way of working with a group of related classes or interfaces. This idea of related classes was discussed when we covered the Abstract Factory design pattern. While the Abstract Factory pattern is about creating related classes, the Facade pattern focuses on simplifying their usage once they’ve been created.
To better grasp this concept, let’s revisit the example we used for the Abstract Factory pattern. To allow users of our library to start a server based on a configuration using our Abstract Factory, we could provide...