What is the facade mode?
According to my understanding, a unified interface is provided for a series of sub-objects or systems.
During use, this interface transmits the requirements sent by the client to various subsystems.
In a word, the facade mode is generated to simplify client operations.
A simple example is:
I want to watch TV before, just turn on the TV
But now we have a set-top box. It takes two steps to watch a TV: turn on the TV and turn on the set-top box.
If I want to watch TV one day, I just need to say-I want to watch TV and then turn on the TV and the set-top box automatically. How nice it is.
It can be seen that in the actual development process, for those who have not learned the design pattern, they may also have used this pattern, but do not know the name.
An example of the facade mode:
Simple:
Class;
Class B;
Class C;
Class Op
{
A *;
B * B;
C * c;
Void Call ()
{
A-> Call ();
B-> Call ();
C-> Call ();
}
}
Note that A, B, and C do not have A common base class.
No matter what the model is, it is for application services. If it is complicated and deepened, it is not desirable. I think I was confused when I bought a Design Model Book.
PS: facade mode = simplified client operations (uniform packaging)