"PHP design mode" written in front

Source: Internet
Author: User

"PHP Objects,patterns, and practice" reading notes

Model Basics: What is design mode?

Patterns are a solution to similar problems in a given environment.

--Four-person group (Gang of four) design mode: The basis of reusable object-oriented software

Similar problems are always recurring, and as time goes by and experience accumulates, we can solve these problems gracefully or with difficulty, and summarize some informal solutions that can be reused in the project, and these solutions are design patterns.

Pattern structure: A key element of each design pattern.

The core of a design pattern is composed of four parts: naming, problems, solutions, and effects.

Naming: both concise and descriptive;

Problem: The environment in which problems and problems occur is the basis of a pattern, and finding a problem is more difficult than using a solution in a pattern catalog. This is one of the reasons that formal solutions to certain patterns are misused or overused;

Solution: The pattern describes a solution to a problem, but there may be hundreds of subtle differences in implementation, and "solutions" can be called "semi-finished products in design mode";

Effect.

"PHP design mode" written in front

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.