A Facade Pattern says that just "just provide a unified and simplified interface to a set of interfaces in a subsystem, therefore it hides the complexities of the subsystem from the client".
In other words, Facade Pattern describes a higher-level interface that makes the sub-system easier to use.
Practically, every Abstract Factory is a type of Facade.
Advantage of Facade Pattern
Usage of Facade Pattern:
It is used:
Example of Facade Pattern
Let's understand the example of facade design pattern by the above UML diagram.
UML for Facade Pattern:
Implementation of above UML:
Create a MobileShop interface.
Create a Iphone implementation class that will implement Mobileshop interface.
Create a Samsung implementation class that will implement Mobileshop interface.
Create a Blackberry implementation class that will implement Mobileshop interface .
Create a ShopKeeper concrete class that will use MobileShop interface.
Now, Creating a client that can purchase the mobiles from MobileShop through ShopKeeper.