Applied Design Patterns with Java

Structural :: Facade (185) {C ch 13}


Collaborations

Consequences

The Facade pattern has the following consequences:

  1. It shields clients from subsystem components, thereby reducing the number of objects that clients deal with and making the subsystem easier to use.
  2. It promotes weak coupling between the subsystem and its clients. Often the components in a subsystem are strongly coupled. Weak coupling allows varying the components of the subsystem without affecting its clients. Facades help layer a system and the dependencies between objects. They can eliminate complex or circular dependencies. This can be an important consequence when the client and the subsystem are implemented independently. Reducing compilation dependencies is vital in large software systems, saving time by minimizing recompilation when subsystem classes change. Reducing compilation dependencies with Facades can limit the recompilation needed for a small change in an important subsystem. A Facade can also simplify porting systems to other platforms, because it's less likely that building one subsystem requires building all others.
  3. It doesn't prevent applications from using subsystem classes if they need to, allowing a choice between ease of use and generality.

Catalog Structural Prev Next