Let's take a look at the definition of facate: provide a uniied interface to a set of interfaces in a subsystem. fa çade defines a higher-level interface that makes the subsystem easier to use. provides a unified interface to the subsystem. It defines a higher level interface to make the subsystem easier to use.
To reduce the complexity of the system, we divide a system into multiple subsystems. See the following complex system:
But what should customers do? In the face of various subsystems, some of them don't care at all. Sometimes they will feel worried and complicated.
In addition, sometimes the complexity of subsystems increases. In this case, facate is the best solution. See:
In the middle, we provide users with a facade that allows them to manage the subsystems of customer interest in a unified manner. In this way, some simple customers can directly use facate, instead of jumping into a complex master system. Of course, for customers with relatively high requirements, it can directly cross the facate layer and directly call it in the main system. As you can see above, this method is being restructuredCodeThe system is often used. For refactoring, you can refer to a reposted article about "refactoring ".Article. Link this URL: An example can be seen in the http://www.dofactory.com/Patterns/PatternFacade.aspx#_self2.
References:
Http://www.dofactory.com/Patterns/Patterns.aspx
Design Pattern: the basis for reusable Object-Oriented Software