What is the Facade pattern? How does it differ from Adapter?
Facade provides a single, simplified interface in front of a complex subsystem with many interacting classes, hiding that complexity from the client — e.g. a single `OrderFacade.placeOrder()` method that internally coordinates inventory, payment, and shipping services. Adapter also wraps something, but its purpose is different: Adapter converts one incompatible interface into another the client already expects, while Facade simplifies an interface the client would otherwise have to navigate directly.
Ready to master this question?
Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.
Sign in to generate a response