Structure pattern of PHP design pattern-PHP Tutorial

Source: Internet
Author: User
PHP design pattern: structure pattern. 51CTO exclusive article] we learned in the PHP design patterns forum that there are many similarities between the structure patterns, because there are several relationships in the object model structure: following BKJIA exclusive between classes] we learned in PHP design patterns that there are many similarities between schema patterns, because there are several relationships in the object model structure: the inheritance and implementation between classes and the combination of objects are the main purposes of the PHP design pattern.

For more information about PHP design patterns, see previous reports on BKJIA:PHP design pattern: responsibility chain pattern Proxy mode in PHP design mode

The biggest advantage of object combination is that you can establish a relationship based on the configuration at runtime without modifying the actual code. it is an operation required for class inheritance and interface implementation. In fact, you can define the function of an application by modifying the link between objects rather than between classes, which is part of the design.

Structure mode list

Adapter-Bridge-appearance Adapter-Bridge-Facade)

The goal of these three models is competition coupling:
◆ Adapter mode Adapter) use different interfaces to connect objects;
◆ Bridge Mode) separates an M abstraction layer and an N implementation layer into N + M classes, replacing M * N usage;
◆ Appearance mode Facade) create a unified interface to access the subsystem.

Composite-decoration-Proxy Composite-Decorator-Proxy)

These three modes maintain the same object interface, and they add orthogonal attention transparently, so the client will not notice:
◆ The composite mode adds a container organization hierarchy for other objects and reuse the tree as the leaves of other trees;
◆ The decoration mode authorizes the addition of behaviors through interception methods to avoid introducing a large number of child classes;
◆ Authorize an object that does not exist or is difficult to access in proxy mode.

Finally, the enjoy meta mode Flyweight) is an unauthenticated ValueObjects standard implementation.

Original article name: Practical Php Patterns: Structural patterns summary author: Giorgio

Source:Http://giorgiosironi.blogspot.com/2010/02/practical-php-patterns-structural.html

  1. PHP design pattern: responsibility chain pattern
  2. Proxy mode in PHP design mode
  3. Top 10 tips for PHP developers to get twice the result with half the effort
  4. FirePHP: debug your PHP code like Firebug
  5. How to correctly implement PHP to obtain blog Data

In the broad PHP design patterns forum, we learned that there are many similarities between schema patterns, because there are several relationships in the object model structure: the inheritance between classes...

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.