Design Mode-facade Mode

Source: Internet
Author: User

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)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.