Interpreting design Patterns----appearance patterns (façade pattern)

Source: Internet
Author: User

I. Introduction to the Model

Appearance patterns (façade pattern) can wrap a series of complex classes into a simple, closed interface. Also called the façade mode.

Second, the mode of intent

Each design pattern has its purpose, and we look at how the design patterns of the patriarch say it. According to Gof, the façade pattern is intended to provide a consistent interface for a set of interfaces in a subsystem, and the façade pattern defines a high-level interface that makes the subsystem easier to use.

Model UML (The following image is transferred from http://www.dofactory.com/)

Iv. Model Participants

Façade (façade) Role: A method by which a client can invoke this role.

This role is aware of the functions and responsibilities of the related (one or more) subsystems.

Normally, this role delegates all requests sent from the client to the appropriate subsystem.

subsystem (SUBSYSTEM) Role: You can have one or more subsystems at the same time.

Implement subsystem functions to handle tasks assigned by a façade object.

Each subsystem is not a separate class, but rather a collection of classes.

Each subsystem can be called directly by the client or by a façade role.

Subsystems do not know the presence of the façade, for the subsystem, the façade is just another client.

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.