Home  >  Article  >  What are the structural design patterns?

What are the structural design patterns?

烟雨青岚
烟雨青岚Original
2020-06-29 15:46:117776browse

Structural design patterns include Composite, Facade, Proxy, Adapter, Decrator, Bridge and Flyweight (Flyweight).

What are the structural design patterns?

In the design mode, the structural types are:

1. Composite, the combination mode: Combine objects into The tree structure represents the relationship between parts and the whole, and Composite enables users to use single objects and combined objects consistently.

2. Facade, appearance mode: Provides a consistent interface for a set of interfaces in the subsystem. Fa?ade provides a high-level interface, which makes the subsystem easier to use.

3. Proxy, proxy mode: Provide a proxy for other objects to control access to this object

4. Adapter, adapter mode: Convert one type of interface into another interface that the customer wants. The Adapter mode allows classes that cannot work together because of incompatible interfaces to work together.

5. Decrator, decoration mode: Dynamically add some additional responsibilities to an object. In terms of added functions, the Decorator mode is more flexible than generating subclasses.

6. Bridge, bridge mode: Separates the abstract part from its implementation part so that they can change independently.

7. Flyweight, flyweight mode

For more related knowledge, please visit PHP Chinese website! !

The above is the detailed content of What are the structural design patterns?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn