Download presentation
Presentation is loading. Please wait.
1
CS 350 – Software Design The Facade Pattern – Chapter 6
Many design patterns are catalogued in the “Gang of Four” text. I find their definitions not to help much unless you already understand what it says. Thus they are not very helpful once the patterns get more complex. However, our first pattern, the Façade is quite simple. So their definition isn’t too bad: Provide a unified interface to a set of interfaces in a subsystem. Façade defines a higher level interface that makes a subsystem easier to use. It’s really the second sentence that captures the meaning of the Façade to me. It’s basically saying that we need a simpler way to access a complex system.
2
CS 350 – Software Design The Facade Pattern – Chapter 6
It is quite often in a large company that programmers develop a specific skill that everyone does not know. Imagine you had to learn a CAD system. They are quite complex. Everyone on the team shouldn’t have to learn the details of programming in CAD. If everyone had to learn every detail, think of the time wasted reading all those manuals!
3
CS 350 – Software Design The Facade Pattern – Chapter 6
A better approach is for one person (actually two people to have a backup on the knowledge base) learn the complex system and develop the interface that everyone else can access. This insulates the clients (in this case other programmers) from the subsystem. It also has the benefit of allowing the subsystem to change with the least effect on the main application. Typically the façade works with a subset of the overall subsystem.
4
CS 350 – Software Design The Facade Pattern – Chapter 6
Key Features for the Façade Pattern: Intent: You want to simplify how to use an existing system. You need to define your own interface. Problem: You need to use only a subset of a complex system. Solution: Create a new interface for the client to use. Participants and Collaborators: Simplified interface for client Consequences: Simplifies the us of a required subsystem, but reduces options. Implementation: Define a new class (or classes) that has the required interface and uses the existing system.
5
CS 350 – Software Design The Facade Pattern – Chapter 6
Complexity can be greatly reduced for the application that accesses a façade instead of a or many subsystems:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.