← Design Patterns learning pathDesign Patterns · Module 4 of 10
Adapter and Facade
Make incompatible interfaces work and simplify complex systems.
📖 Key ideas
- Adapter converts one interface into another clients expect.
- Example: wrapping an old payment API to match a new interface.
- Facade provides a simple interface to a complex subsystem.
- Example: OrderService.placeOrder() hides stock, payment and email steps.
- Both reduce coupling between code parts.
💡 Real-life example: An adapter is a travel plug converter; a facade is a hotel reception handling everything behind the scenes.
AdapterConverts one interface to another
FacadeSimple front for a complex system
WrapperObject wrapping another
SubsystemGroup of related classes