Home > Common Problem > body text

What are the elements of design patterns?

烟雨青岚
Release: 2020-06-29 15:28:02
Original
5965 people have browsed it

The design pattern elements are: 1. Pattern name, used to describe the design pattern, solution and effect; 2. Problem, mainly describing when to use the design pattern; 3. Solution, describing the composition of the design Components, their interrelationships and their respective responsibilities and collaboration methods; 4. Effects, describing the effects of pattern application and the trade-offs of using patterns.

What are the elements of design patterns?

The basic elements of a design pattern are: pattern name, problem, solution and effect.

1. Pattern name: a mnemonic name used to describe design patterns, solutions and effects.

2. Question: Mainly describes when to use design patterns.

3. Solution: Describes the components of the design, their interrelationships, their respective responsibilities and collaboration methods

4. Effect: Describes the effect and usage mode of the pattern application A matter of trade-offs.

Design pattern (Design pattern) is a set of classified and cataloged summary of code design experience that is used repeatedly, known to most people. The purpose of using design patterns is to reuse code, make the code easier to understand by others, and ensure code reliability.

There is no doubt that design patterns are win-win for ourselves, others, and the system; design patterns make coding truly engineering; design patterns are the cornerstone of software engineering, just like the structure of a building.

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template