← Design Patterns learning path
Design Patterns · Module 4 of 10

Adapter and Facade

Make incompatible interfaces work and simplify complex systems.

📖 Key ideas

  1. Adapter converts one interface into another clients expect.
  2. Example: wrapping an old payment API to match a new interface.
  3. Facade provides a simple interface to a complex subsystem.
  4. Example: OrderService.placeOrder() hides stock, payment and email steps.
  5. 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