In Facade pattern, a single class represents an entire complex system. It provides a simplified interface to a library, a framework, or any other complex set of classes.
For example consider a restaurant. When the customer go to a restaurant and order some food, then the operator give the voice interface on behalf of the restaurant. This is the façade for the customer. The customer don’t need to know, how the food will be made, what temperature it will be burn, what materials will be used etc.
When to use facade pattern
You can use facade pattern in order to simplify the problem when there are multiple complex subsystems and interacting with them individually is really difficult.
Real life example
- A shopkeeper is a facade for all the items in the shop.
- A travel site is a facade for customers for different holiday or travel packages.
- The customer care is a facade for customers for different services.