Façade pattern sits on the top of group of subsystems and allows them to communicate in a unified manner.

Figure: - Façade and Subsystem
Figure ‘Order Façade’ shows a practical implementation of the same. In order to place an order we need to interact with product, payment and invoice classes. So order becomes a façade which unites product, payment and invoice classes.

Figure ‘façade in action’ shows how class ‘clsorder’ unifies / uses ‘clsproduct’,’clsproduct’ and ‘clsInvoice’ to implement ‘PlaceOrder’ functionality.

Figure :- Façade in action
Asked In: Many Interviews |
Alert Moderator