[design mode] Adapter mode and appearance mode

Source: Internet
Author: User

The previous decorator pattern was to wrap objects and give them new functionality. The adapter pattern is to wrap objects so that their interfaces do not look like themselves but other objects, that is, to convert the interface of the class into the desired interface in order to implement different interfaces. The appearance mode, in turn, wraps the object to simplify its interface.

The adapter mode tells the interface of a class and transforms it into another interface that the customer expects. Adapters allow classes that are incompatible with the original interface to work together.

The appearance mode provides a unified interface for accessing a group of interfaces in a subsystem. The appearance defines a high-level interface that makes the subsystem easier to use. This model also shows a design principle, the least knowledge principle.

[design mode] Adapter mode and appearance mode

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.