PHP Design Patterns - Overview

       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:

        1) multiplex solutions: design pattern itself is a universal solution for a certain type of problem, is a higher level of multiplexing, beyond code reuse.

        2) determine the generic term: the development of the communication and collaboration needs of its foundation common vocabulary and common understanding of the problem . When you want to express but expression is not clear when the design ideas, even if expressed colleagues will be misunderstood , design patterns to show the advantages of the communication.

        3). The code easier to modify and maintain. Because design patterns are proven solutions, their structures are formed over a long period of development, good at dealing with change, design patterns on the package itself is a point of change.

        4). Mode helps to improve the level of thinking. After learning mode, even if the method without mode, will be better to take a better strategy to solve the problem.


        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:


          23 kinds of conventional object-oriented design patterns

Published 101 original articles · won praise 113 · views 330 000 +

Guess you like

Origin blog.csdn.net/jhq0113/article/details/44906491