🎨 Design Patterns (Gang of Four)
Beginner
What is the Facade design pattern?
Answer
The Facade pattern provides a simplified interface to a complex subsystem of classes. It does not hide the subsystem — it just gives clients a clean, high-level entry point. For example, a home theater system has many components (projector, amplifier, DVD player, lights). A HomeTheaterFacade exposes simple methods like watchMovie() and endMovie() that internally coordinate all the components. Facades improve code readability and reduce coupling between the client and the subsystem. Frameworks like Laravel and Spring are essentially large facades over complex infrastructure.