Professional Documents
Culture Documents
Facade Design Pattern
Facade Design Pattern
React Developer
You want to
Simplify
Complex
set of classes
/masabmehmood
Masab Mehmood 02
React Developer
So here is the
Facade
Pattern
comes in
rescue
/masabmehmood
Masab Mehmood 03
React Developer
Facade
Pattern
Facade is a structural design pattern that provides a
simplified interface to a library, a framework, or any
other complex set of classes.
/masabmehmood
Masab Mehmood 04
React Developer
Real-World
Analogy
The order goes to the kitchen and the food comes
back after a while. Simple!
Applicability
The Facade pattern is widely used and applicable in many use cases. Use the
/masabmehmood
Masab Mehmood 06
React Developer
Structure
The structure of the Facade is simple. It contains our Facade and many subsystem
classes.
/masabmehmood
Masab Mehmood 07
React Developer
Participants
From the structure, you can derive the following participants:
1: Facade
Knows how to interact with the subsystem classes and delegates client
requests to a particular part of the subsystems's functionality.
2: Subsystem classes
Consists of many objects with complex functionality. To make them work
properly, you must dive deep into the subsystem's functionality. The
subsystem does not know the Facade.
/masabmehmood
Masab Mehmood 08
React Developer
Code
Example
/masabmehmood
Masab Mehmood 09
React Developer
/masabmehmood