- They fall into structural pattern categories.
- Façade pattern sits on the top of group of subsystems and allows them to communicate in a unified manner.
- The façade takes care of orchestration part and present more simplified interface to the client.
In a typical online shopping cart when a customer places any order following things happens.
- Get Product Details
- Make Payment
- Print Invoice
The above example can be implemented using Facade pattern as follows:
- The main class (clsOrder) is exposed to the client which internally takes care of calling other related classes (clsProduct, clsPayment, clsInvoice).
- The clsOrder class acts as a facade class which takes care of orchestration by calling other related classes internally.