PHP design mode

Source: Internet
Author: User
  1. Factory mode

Unify the creation and return of the object (instance) of the class.

2. Single case

Avoid instantiating objects multiple times in one life cycle

3. Strategy

All policies implement a unified interface, depending on the scenario, using different objects, choose different strategies.

4. Agent

Wake-up to the business implementation of encapsulation, direct use, do not pay attention to details.

5. The viewer

When an event occurs when an event is called, the business logic of a series of observers is triggered in the event, and the observer can be dynamically added to the event person

6. Decorative Device

To one object of a business to add a different decoration, different decorations to achieve a unified decorative interface, in the object business unified implementation of all the decoration business.

7. Registrar

Accessing an instance of an object

8. Iterators

SPL Iterater

This article is from the "Jinghong" blog, please be sure to keep this source http://haocaige.blog.51cto.com/1319521/1606996

PHP design 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.