The Façade pattern gives a complex subsystem a simpler, higher-level interface. A façade hides the subsystem’s multiple interfaces so clients can perform a task through fewer calls. section 10.2 section 10.4
Fundraising through one operation
A university fundraising application coordinates alumni solicitations, booster-club meetings, and student-fee collection. Instead of having AthleticsDept and Administration call Alumni, BoosterClubs, and Students directly, both call FundRaiser.do_fund_raising(). FundRaiser contains the sequence of subsystem calls. section 10.2.3 section 10.2
A façade improves the surrounding design by:
- Reducing duplication by placing fundraising operations in one façade method. section 10.2.3
- Loosening coupling because clients depend on FundRaiser rather than each subsystem class. section 10.2.3
- Containing change because adding another fundraising class affects the façade instead of every client. section 10.2.3
Listing 10.20 (Program 10.5 Funds-FaçadeDP) fund_raiser.py
from alumni import Alumni
from booster_clubs import BoosterClubs
from students import Students
class FundRaiser:
def do_fund_raising(self):
alumni = Alumni()
clubs = BoosterClubs()
students = Students()
alumni.send_solicitations()
clubs.schedule_meetings()
students.collect_fees()
View the compact Python implementation of FundRaiser and its single do_fund_raising() operation. section 10.2.3
Choose a façade when the problem is a complex subsystem that needs a simpler entry point. Choose an Adapter when an existing class must be converted to a required target interface. section 10.3


