What do you think of pure object-oriented PHP programs?

Source: Internet
Author: User
What are the pure object-oriented PHP programs that everyone knows? What are the opinions on the architecture, development, and performance of object-oriented PHP programs? What are the pure object-oriented PHP programs that everyone knows? What are the opinions on the architecture, development, and performance of object-oriented PHP programs? Reply: The goal of OOP is not to improve operation efficiency, but to develop efficiency ~ For PHP, the performance loss due to the use of OOP is negligible compared with the development and maintenance benefits it brings ~ From my only experience, the object-oriented PHP application requires more work to improve the running efficiency. The advantage is that it is more conducive to modularization and code reuse. However, I always think that PHP is not an object-oriented idea For OOP. It has nothing to do with language. What's more, php5 has improved the OO syntax, so there is no major obstacle in terms of language. The reason why OO is not popular is that the idea of the entire php community is not keeping up. Many people still think that php is specially designed for small and medium-sized websites and do not want to develop or learn frameworks. This is also a poor influence on the early php design ideas. In fact, php should have a larger role and a broader space, taking the object-oriented approach is the inevitable choice of a single portal architecture form. After reaching a certain scale, the performance problem will become more and more significant. After php5, the object running efficiency is already good, the extensive use of OOP makes PHP more like a language. I feel that oop is mainly easy to maintain, and the efficiency of team-based collaborative development is very high, so it is much easier to control the project scale. Php development must follow the path of oop. Isn't the current php framework all oop?
When it comes to running efficiency, when it comes to running efficiency due to oop, oop is no longer a problem.
If php is not suitable for oop, isn't php only suitable for small projects? Phper should not be cheap. It is mainly used for modularization. If PHP uses pure OOP ideas, it will be awkward. When talking about object-oriented, we must first put aside the program. Object-oriented is an idea, not a language. For example, a demand comes, how do we understand our own needs, how to turn the needs into their own ideas, write a summary of the design, draw a E-R diagram, create a database, the demand into a program. Everything is an object. It tells us that I want to analyze things in an object way. For example, if we use an object-oriented method to analyze the action of drinking water: the process is to first pick up the open water bottle, open the bottle cap, pour into the cup, close the bottle cap, put down the open water bottle, and drink water. Some of the things that appear in this process can be visualized: open water bottles, cups, and people.
Of course, if you want to divide it carefully, you can add water and bottle caps. After such an analysis, do you immediately feel that your thinking is complete, and the following Shenma document and database design are full of clouds? As to the language used for implementation, it is just a means. Well, the program is dead, but our programmers can give it life and energy. Php was not designed for oop, so that the oop features added later became very strange. The biggest advantage of php is casual. It's not suitable if you're too particular.

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.