1 / 9

Façade Design Pattern

Façade Design Pattern. Source: Design Patterns – Elements of Reusable Object-Oriented Software; Gamma, et. al. Problem. A subsystem contains lots of classes, all of which are necessary to perform its function Most of the subsystem's internal complexity is not directly relevant to its clients

guentherj
Download Presentation

Façade Design Pattern

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Façade Design Pattern Source: Design Patterns – Elements of Reusable Object-Oriented Software; Gamma, et. al.

  2. Problem • A subsystem contains lots of classes, all of which are necessary to perform its function • Most of the subsystem's internal complexity is not directly relevant to its clients • We want to simplify the client's interface to the subsystem to make it easier to use • We want to minimize client dependencies on the subsystem's internal details

  3. Solution • Introduce a Façade object that provides a simplified interface to the subsystem • The Façade's interface provides exactly those operations needed by most clients, and no more • The Façade translates high-level client requests into lower-level requests on subsystem objects • Internal subsystem objects have no knowledge of the Façade

  4. Solution • Most clients interact with the subsystem strictly through the Façade • Advanced clients may still be allowed to access the full scope of subsystem functionality, but most clients don't need or want to • Similar to keeping a class' implementation details private, and making public only those operations directly needed by clients (i.e., information hiding)

  5. Consequences • Makes using the subsystem easier • Reduces coupling between clients and the subsystem • Reduces compilation dependencies, thus minimizing recompilation time • Useful for defining the interfaces between layers in a layered system

  6. Known Uses: Compilers

  7. Known Uses: Web Applications

  8. Known Uses: CS240 Chess Program

  9. Known Uses: CS240 Chess Program

More Related