Facade Pattern

The Façade pattern provides a unified interface to a group of interfaces in a subsystem. The Façade pattern defines a higher-level interface that makes the subsystem easier to use because you have only one interface. This unified interface enables an object to access the subsystem using the interface to communicate with the subsystem.

UML representation


The following lists the benefits of using the Façade pattern:
  • Provides a simple interface to a complex system without reducing the options provided by the system
  • Shields clients from subsystem components
  • Promotes weak coupling between the subsystem and its clients
  • Reduces coupling between subsystems if every subsystem uses its own Façade pattern and other parts of the system use the Façade pattern to communicate with the subsystem
  • Translates the client requests to the subsystems that can fulfill those requests

When to Use

You should use the Façade pattern when:
  • You want to provide a simple interface to a complex subsystem.
  • There are many dependencies between clients and the implementation classes of an abstraction.
  • You want to layer your subsystems.
Subpages (1): Facade Pattern Example