The status and prospect of PHP's development Framework _php Digest

Source: Internet
Author: User
Tags documentation file upload php language reflection zend zend framework ruby on rails
The current situation and prospect of PHP development framework

Introduction:

With the popularity of the Ruby on Rails, the popular Web application scripting language of PHP also has a large number of new generation development frameworks. At the same time, the domestic PHP developers also began to follow the foreign development, launched a different development framework.

Ruby on Rails creates change

Before the Ror, there were many development frameworks in the PHP field, such as Mojavi, Wact, Phpmvc and Seagull. Although these frameworks also use the MVC pattern, the database abstraction layer and so on technology. But since PHP itself was not as popular as it is now, these frameworks have not been applied in large numbers and ended in silence.
And after feeling the rapid development capabilities offered by ROR, the PHP community has been injected with stimulants. Various applications and development frameworks abound.

The birth of a new generation of frames

The PHP community did not get into too much controversy after being stunned by the ROR. Instead, we started the design of a new generation of frames by acting immediately. The first groups that appeared first were almost all ROR clones. For example, PHP on Trax (even names are borrowed from Ruby on Rails) and taniphp, Akelos, and so on. The most important feature of these frameworks is to strive for 100% clone Ror, whether in the architecture, design pattern, or use method.
These frameworks did attract the developer's attention at first, but as the developers get to know them, the halo of these frames fades. Obscure architectures, poor performance, and too many limitations make these frameworks difficult to apply in real-world projects.
At this point, many PHP developers think that they can learn from ror design ideas, but should not copy the structure and implementation of ROR. To this end, some of the frameworks that also promote rapid development are beginning to appear in the PHP community. In these frameworks, cake and symfony are outstanding.

cake (http://www.cakephp.org/)
Cake is full of Ror shadow, from ActiveRecord mode to view layout management and Ror very similar. and cake at the beginning also try to achieve a lot of things like Ror. But the cake's development team later found that there was a huge difference between the PHP language and the Ruby language, so many of the designs in Ror lacked practical value even if they were implemented in PHP.
Cake in the development gradually out of the shadow of Ror, began to explore more can play the PHP language itself advantages of the architecture and implementation. So there was a time when the cake API changed so dramatically that other developers stopped and waited.
However, due to the unreasonable structure and the imitation of ror too much, the core of cake is becoming more and more difficult to understand and the performance is unsatisfactory. and cake will be a huge database operation object as the basis of all business objects. While this facilitates rapid development, it makes testing of business logic objects very difficult.
For smaller projects, cake is ideal. Excellent rapid development capabilities, rich APIs, and detailed documentation can help developers get their work done quickly. But as the scale of the project increases, the limitations of cake become prominent.

Symfony(http://www.symfony-project.com/)
Symfony is a very mature framework that leverages existing open source projects in large numbers. Symfony uses Mojavi's core code to implement the framework's MVC pattern, using propel as the database abstraction layer. Symfony is not only powerful, but also has full support for Ajax. Coupled with the extensive documentation and tutorials provided by the official web site and an active community, many developers are welcome.
But the biggest problem with Symfony is that it uses too many open source projects of different styles to combine into a framework. Because Mojavi and propel themselves are quite complex, the structure of symfony is very complex and difficult to understand and learn.
But for businesses that want to choose a framework as an enterprise's internal system infrastructure, symfony maturity, rich documentation, and an active community are worth considering. After all, the enterprise's internal system is more focused on stability and long-term support.

Business interests and the road to Jane

After seeing the potential commercial value of the PHP development framework, Zend.com United IBM announced that it was going to launch a development framework that would really give PHP its edge. For a time, this message caused an earthquake in the entire PHP community. Everyone is starting to look forward to the "official" background of the development framework to the PHP developers to point out a correct path.
However, as the Zend Framework team publishes several snippets of code, it is immediately possible for developers to point out that these snippets are impossible to implement. It turns out that these snippets of code are just beautiful ideals. Limited to the capabilities of the PHP language itself, the Zend framework ultimately did not achieve the implementation of the Ror ActiveRecord pattern originally promised.

Zend Framework(http://framework.zend.com/)
The Zend framework applies a large number of new object-oriented features in PHP5: interfaces, exceptions, abstract classes, SPL, and so on. The application of these things makes the Zend Framework highly modular and flexible. At the same time, because of strict adherence to the principles of "interface Programming" and "single object Responsibility", the Zend Framework is promising to become an excellent enterprise application development framework.
Unfortunately, the Zend Framework has not made more breakthroughs until today. When using the Zend Framework development, the framework does not provide any help for the logical separation of the most important areas of the application itself. If you want to develop truly robust enterprise applications, developers will still need to make considerable effort and build their own infrastructure on top of the Zend framework.
In response, critics point out that the Zend framework, while heavily applying the new features of PHP5, has not translated these advantages relative to PHP4 into something that can help developers.

For simple and small projects, the Zend framework does not improve development efficiency. Instead, because of the application of a large number of object-oriented design and PHP5 in the framework of new features, developers put forward higher requirements, indirectly increase the cost of project development. For larger projects and enterprise applications, the Zend framework is a good foundation. But to create a successful application, still need to pay a lot of effort. And always pay attention to the performance problem of Zend Framewok.

Code igniter(http://www.codeigniter.com/)
Code Igniter can be said to be a dark horse. The advent of Code igniter is precisely the time when symfony and cake are doing their way, and the Zend framework is much anticipated. With unique design ideas, Code igniter attracts a large number of developers. This can be confirmed by its fiery official forum.
Code igniter The principle of "simplicity is beauty". There is no fancy design pattern, no gorgeous object structure, everything is so simple. A few lines of code can begin to run, and a few lines of code can be used to output it. Most of the things you use in your daily development can be found immediately and can be easily used. Code Igniter is a model of "Avenue to Jane".
However, the implementation of the Code igniter itself is not ideal. The internal structure is too confusing, although simple to use, but lacks the ability to expand. Therefore, when developing into the 1.5 series version, the author had to provide scalability for the framework by adding various hooks.

Domestic PHP Development Framework

Although some developers have published frameworks in the past, these frameworks are either too simplistic or tightly coupled to a particular type of application, lacking versatility. Until the 2006, with PHP in the domestic large number of applications and sought after, the real domestic PHP development framework was released.

FCS (http://fcs.org.cn/)
FCS is a Chinese PHP development framework ported from the Java struts structure, Using the object-oriented development architecture and the MVC pattern, and simulation to achieve the struts of the tag library, borrowed some good ideas abroad, especially the Java framework, so familiar with Java developers relatively easy to get started, its template engine, caching mechanism, authentication mechanism and extensibility aspects are outstanding.
in the reference to foreign excellent ideas, FCS also more consideration of domestic application development needs. PHP4 compatible, fully support UTF-8, and pathinfo support, and so on, more conducive to domestic host environment and development needs. With the principle of ease of use and scalability, FCS employs Easy-to-understand projects, modules, and operational mechanisms with built-in automated operations to make application development simpler, and its functionality can be expanded flexibly through base class libraries and various plug-ins to meet growing business needs. It is precisely because of the good development structure that FCS does not appear to have many obstacles in the development of large applications, the component-based approach, and the project management mechanism that fits into the framework, can also allow you to develop the skills to handle large applications.
FCS seeks to streamline the code and all-Chinese culture of documents, comments, for the domestic PHP developers to learn and master, but according to the current situation, official documentation and community support is still relatively scarce, and AJAX support is not comprehensive, so the domestic application maturity is not enough.

fleaphp(http://www.fleaphp.org/)
Fleaphp from the perspective of development, is a certain historical framework. Over the past three years, Fleaphp has released the first truly mature and stable development framework from the PFC1 to the PFC3 series and the FLEA1 test framework.
Unlike many other frameworks, the fleaphp design began with a two-point focus on rapid development and full use of PHP's own advantages. Therefore, the greatest feature of fleaphp is the high degree of modularity and the ability to expand.
The core of the fleaphp framework is very small, but with a flexible configuration, you can assemble various types of infrastructure. For simple script pages, fleaphp does not need to load the MVC pattern, just to provide the business logic and database services for the application. For complex applications, fleaphp can complete a wide range of tasks from the MVC mode invocation, access control, data validation to file upload, picture processing, and so on.
Thanks to this excellent customization and scalability, fleaphp is truly close to the goal of "satisfying the diverse needs of simple application to enterprise development". And unlike many other frameworks, fleaphp is a framework that is completely refined in real-world development. Therefore, along with the development of fleaphp, a variety of practical applications have appeared successively. On the official website of fleaphp, you can see a variety of practical applications. From the simplest corporate promotional sites, to complex community sites, enterprise internal systems, and so on.

Fleaphp as a fully domestic framework, with complete Chinese culture of documents, code comments, and in the extended function also focus on the actual needs of domestic developers. As a result, fleaphp is more likely to be accepted by domestic developers than a variety of frameworks abroad.
However, because of being at home, fleaphp face much more difficulties than the foreign counterparts. The lack of sufficient contributors, disrespectful censure, and a skeptical eye all make fleaphp's development team members more dedicated. And because of the lack of sufficient contributors, the fleaphp framework currently has a small gap in document and extension functionality compared to other mature frameworks.
And like all other PHP development frameworks, fleaphp has not found a way to help developers isolate the application domain logic. Although there are guidance documents, it is useful for the novice developer to use a domain logic base that can be used.

Reflection and enterprising

Ror's shock wave is far from over, but PHP developers are already starting to rethink whether the pursuit of Ror is really a qualitative change to PHP development.
Ror is able to achieve such a great success, in addition to Ror's own design ideas, there is also an important reason is that ROR make full use of the language of Ruby's expertise. Take advantage of Ruby's dynamic language. And in PHP if only simply copy Ror design, you have to encounter the limitations of the PHP language itself. To circumvent these limitations, developers have had to solve problems with some difficult and understandable techniques. However, this usually results in the structure of the framework becoming obscure and performance impaired.
In this reflection, the Code igniter, fleaphp and other frameworks are the best answer to this question. Only by taking full advantage of the PHP language itself can the PHP development be made simpler and more interesting.

Development to today, a variety of PHP development framework, although with their own characteristics, but almost all to improve the development efficiency and efforts. However, while some of these frameworks note the issue of improving application maintainability, there is no solution to this critical issue of domain logic separation. And that's what these frameworks are for in the future.
For simple Web applications and complex enterprise applications, the difference between the two is doomed to the need to adopt a fixed architecture. So a framework like fleaphp that provides custom architectural capabilities allows developers to try different combinations of frameworks to address different levels of requirements from simple to complex.

In the future, PHP will become an increasingly important platform in the field of web development. So we believe there will be more and better development frameworks. Although as a developer, it is not necessarily necessary to adopt a framework to solve the problem. But it is because of these evolving frameworks that we have been pushing the understanding and mastery of using PHP to develop Web applications.

--------------------------------------

PS: This original author is one of the fleaphp developers. Thanks for its contribution to the domestic PHP

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.