PHP development-PHP source code

Source: Internet
Author: User
Ec (2); & nbsp; I have discussed a lot in the PHP framework. I think there are two main problems: first, blindly worship the framework, think that the framework design is orthodox, otherwise it is not a stream, it is a cainiao. Second, the imitation of Java is very serious. I am not saying that imitation is a bad thing. Here we mean that we haven't thought about it carefully, I have not taken into account the principles and objectives of the framework or some designs, the actual situation of undertaking projects, and the similarities and differences between Java and PHP, and blindly conducted some & ldquo; model script ec (2 ); script


I have discussed a lot about the PHP framework. I think there are two main problems here: first, blindly worship the framework and think that adopting the Framework Design is orthodox. Otherwise, it is not a stream or a cainiao. Second, the imitation of Java is very serious. I am not saying that imitation is a bad thing. Here we mean that we haven't thought about it carefully, I have not considered the principles and objectives of the framework or some designs, undertaken the actual situation of the project, and the similarities and differences between Java and PHP, and blindly carried out some "Imitation" work. The article "three phases in PHP development" is an article on "actual project situations", focusing on the characteristics of PHP development in different development fields. If any, please correct us.

Note: The content is personal feelings. For more information, see the source.


Three cores in PHP Development


In the field of PHP development, we are constantly discussing OO, frameworks, design patterns, MVC models, and various benefits. I do not deny these benefits. I just think that we cannot blindly follow a development method. All methods are applicable, and PHP development is no exception. PHP development can be divided into three different development fields based on the audience and service objectives: Industry Commercial Software, Common Shared SoftwareAnd Private software. The main development methods used in these different fields are also different. It is necessary to clarify the domain of your product and determine a development method. It should be noted that these three categories are not strictly tied for each other, and they are distinct. I hope this will not be a problem for everyone. Just understand what it means. :)

It is also limited to the narrow level of personal opinions and opinions. Some Opinions may inevitably be biased or even extreme, and we hope you will give us some advice.


First, let's talk about Industrial Commercial Software:
This type of software is mainly applicable to specific industries or enterprises, and the project design is complicated. Generally, it is undertaken independently by a development company, with almost no competitors. Currently, it is mainly represented by CRM, CMS, OA, etc. Customers of such software do not care about how fast the system is running, but whether the system can coordinate and complete the required functions. Because it is intended for specific customers, the use of such software is relatively narrow. If another customer is used, it will not be able to run well (the running here is not the execution of the Code, but refers to the implementation of the function. To reduce unnecessary basic repetitive work in developing different systems, we must extract the same part of these different system applications. These identical parts contain both the code technical similarity and the design process similarity. This is a process of abstracting the problem. Our existing frameworks and models are the fruits of our predecessors in these abstract processes. Since almost every Java project is usually a relatively large and complex application, we can see the framework and the everywhere mode in these projects. If you do not adopt this development method, you will be unable to move forward. PHP is very similar to Java when developing such applications. The only difference is that their runtime environments (mainly their respective language interpreters, the same below) are different. PHP is a scripting language that supports a variety of OO language features at a high cost. Whether in space or time. Fortunately, the performance of commercial software in this industry is secondary, and the runtime environment can be determined by the user. Therefore, using PHP5 with good support for OO features is an inevitable choice. It is also necessary to adopt some frameworks.

Let's talk about it again. Common Shared Software:
This concept comes from the concept of traditional desktop shared software. Its main feature is that there are a large number of customers (including potential customers), and there are many choices for the same type of software users, which leads to fierce competition. This type of software is currently represented by Forum community programs. To win customers, you must do better than the average competitor. For such software, the competition mainly involves the following aspects:

1. interface. The interface is the first impression of your customers (including customers) on your product. Therefore, the interface must be friendly. The interface not only indicates the appearance, but also includes operability. The interface must take into account the habits of most people, and the operations must be simple and easy. Although the appearance is radish cabbage, you must leave a choice (Interface) to the customer, so that the customer can easily modify and use.

2. Performance. A good interface will certainly give you additional points for your product. However, in the world where Ctrl + C and Ctrl + V can be used, even better interfaces will be instantly "learned" by competitors ". If the interface is the first impression, the performance will be fatal. The interface can be changed, but you cannot expect the customer to complete the code by themselves. In PHP development, performance largely refers to the speed at which code runs. Another important manifestation is the loss of system resources. The lower the resource share of each processing process, the more time the system can process more requests at the same time. These are all subtle points. I hope you will have the opportunity to discuss it in detail. However, my personal principle is to avoid using classes. The class in PHP is really a performance killer. The direct consequence of avoiding the use of classes is to avoid using the framework. Some people say that this will affect the development efficiency. I admit, it may have some such effects. However, I think there are two types of efficiency: development efficiency and operation efficiency. This is not suitable for commercial software in the industry, but we have many competitors in general shared software. Moreover, customers do not care about the framework and mode you use. Customers only care about their own experiences. Rain and bear's paw cannot have both sides. We must discard a little development efficiency to ensure operational efficiency. This is also a last resort.

3. compatibility.

<

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.