Design Mode: facate

Source: Internet
Author: User

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

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.