<\/span><\/h2>\n\n\n\nFacade Pattern is classified as a structural design pattern. This design pattern is meant to hide the complexities of the underlying system and provide a simple interface to the client. It provides a unified interface to underlying many interfaces in the system so that from the client perspective it is easier to use. Basically it provides a higher level abstraction over a complicated system.<\/p>\n\n\n\n
The term Facade<\/strong> itself means<\/p>\n\n\n\nthe principal front of a building, that faces on to a street or open space<\/strong><\/p>\n\n\n\n Only the front face of the building is shown all the underlying complexity is hidden behind.<\/p>\n\n\n\n
Let’s understand the Facade Design Pattern with a simple example. In this era of the digital wallet, when someone actually does a wallet debit\/credit there are a lot of things that are happening in the background which the client may not be aware of. Below list illustrates some of the activities which happen during the credit\/debit process<\/p>\n\n\n\n
Check Account<\/li> Check Security Pin<\/li> Credit\/Debit Balance<\/li> Make Ledger Entry<\/li> Send Notification<\/li><\/ul>\n\n\n\nAs can be noticed, there are a lot of things that happen for a single debit\/credit operation. This is where the Facade pattern comes into picture. As a client one only needs to enter the Wallet Number, Security Pin, Amount and specify the type of operation. The rest of the things are taken care of in the background. Here we create a WalletFacade<\/strong> which provides a simple interface to the client and which takes care of dealing with all underlying operations. <\/p>\n\n\n\n <\/figure><\/li><\/ul><\/figure>\n\n\n\n<\/span>Problem Statement:<\/strong><\/span><\/h2>\n\n\n\nIn order to use the complex system, the client had to know the underlying details. Need to provide a simple interface to the client so that they can use a complex system without knowing any of its inner complex details.<\/li><\/ul>\n\n\n\n<\/span>When to Use:<\/strong><\/span><\/h2>\n\n\n\n