Statement: This series of blog reference "Big Talk design mode", author Geoscience.
The common object-oriented design pattern of about 23 kinds, but since the contact with PHP, and gradually found that the common design patterns seem to be a lot less, the data on the network is relatively small, the side of the PHP colleagues have not even heard of the design pattern, This also may be the development of PHP brought, Because PHP is relatively late for object-oriented support, many PHP programmers also write code according to process-oriented thinking. so I decided to rewrite the object-oriented design pattern originally written in C # with PHP.
What is design mode?
design mode ( Design P Attern ) is a set of repeatedly used, most known, classified purposes, Code Design Experience the summary. Design patterns are used in order to reuse code, make code easier for others to understand , and ensure code reliability. Design patterns in others in the system are multi-win; Design patterns make code compilation truly engineering; Design patterns are the cornerstone of software engineering, like the structure of a building .
The rational use of design patterns in the project can solve many problems perfectly, each of which has its corresponding principle in the present, and each pattern describes a recurring problems that occur repeatedly , and the core solution to the problem, which is why it can be widely used.
Advantages of Design Patterns:
1). Multiplexing Solutions: The design pattern itself is a generic solution to a class of problems and is a higher level of reuse than code reuse.
2). Determine General Terminology: in the development of Communication and collaboration all need common vocabulary and consensus on issues. . When you have want to expression but also the expression is not clear design ideas, even if the expression will be misunderstood by colleagues, design patterns show the advantages of communication.
3). Code easier to modify and maintain. Because design patterns are proven solutions, their structures are developed over the long term and are adept at coping with change, and the design pattern itself is a package of change points.
4). patterns help to improve the level of thinking. Learning mode, even without the method in the pattern, will be better to adopt a better strategy to solve the problem.
In the following pages, we will detail the PHP object-oriented design pattern, this series of blogs with the principle of design patterns as the core, listing the simplest examples, so long as there is a little object-oriented readers can understand.
Share one of my in-house training ppt,23 Object-oriented design patterns, the instance language is C #, and the source code will be served at the end of this series of tutorials:
23 Common Object-oriented design patterns
The above describes the PHP design pattern-overview, including aspects of the content, I hope to be interested in PHP tutorial friends helpful.