Disclaimer: This series of blog references "Westward Design Patterns" by Cheng Jie.
Common object-oriented design patterns about 23 species, but since after contact with PHP, gradually found common design patterns seem to be missing a lot of data on the network is relatively small, around PHP and some colleagues have not even heard of design patterns , which could also be caused by the development of PHP, because PHP object-oriented support relatively late, a lot of PHP programmers wrote the code in accordance with the process-oriented thinking. So, I decided to put the original written in C # object-oriented design patterns rewritten with PHP.
Often hear other programmers (Java, C #), etc. say PHP is not running in the browser-side scripting language, in fact, before I contacted PHP think so too, but later found that PHP is developed in C language, C language is a cross-platform real meaning of language, which is destined PHP is cross-platform, PHP is run on Windows server or Linux operating system server language, it Java and C #, as the code is stored and run on the server side, HTML browser executable script sent to the browser and performs, PHP relative Java and C # for more process-oriented packages, reducing portion datatypes.
PHP is object-oriented, PHP can get such rapid development, the Internet can be widely used in large enterprises to prove that PHP is withstand the test, with the continuous development of mobile Internet, PHP will be wider world.
What is a design pattern?
Design patterns ( Design P attern ) is a set of repeated use, known to most people, after cataloging, code design experience summary. Use design patterns to reusable code, make the code easier to understand others , to ensure the reliability of the code. Design patterns to ourselves to others in the system is a win-win; design patterns make code compiled real engineering; design pattern is the cornerstone of the context of software engineering, as the structure of the building is the same.
Project rational use of design patterns can be the perfect solution to many problems, each mode in the corresponding principle now in both corresponding to each pattern describes a around our problems keep recurring , as well as the core of the problem Cause solution, which is that it can be widely used.
Design Patterns advantages:
In the following pages will detail in the PHP object-oriented design patterns, this series of blog to the core principles of design patterns, citing the most simple example, so long as there is little basis for object-oriented readers Nengkanmingbai.
For more information, please pay attention to my video lessons:
PHP object-oriented design patterns
I share a training within the company's data, C # source code examples and class diagram:
Design patterns UML class diagram source code and
Corresponding to 23 kinds of object-oriented design patterns PPT: