The current situation and prospect of PHP development Framework _php Tutorial

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

Introduction:

With the popularity of Ruby on Rails, PHP, the popular Web application scripting language, has seen a lot of new development frameworks. At the same time, domestic PHP developers began to follow the development of foreign countries, 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 adopt the MVC pattern, Database abstraction layer and other technologies. However, since PHP itself is not as popular as it is now, these frameworks have not been used in a large number of applications, and ultimately attributed to silence.
And after feeling the rapid development capabilities offered by ROR, the PHP community is like being injected with stimulants. A variety of applications and development frameworks abound.

The birth of a new generation framework

The PHP community did not get into too much controversy after being stunned by the ROR. Instead, it immediately began the design of a new generation of frameworks. The first frames that first appeared were almost all clones of Ror. For example, PHP on Trax (even names are referenced by Ruby on Rails) and taniphp, Akelos, and so on. The most important feature of these frameworks is to strive for 100% cloning Ror, regardless of the architecture, design patterns, or methods used.
These frameworks initially did draw the attention of developers, but as developers learned more about them, the halo of these frames faded gradually. Obscure architectures, poor performance, and too many constraints make it difficult for these frameworks to be used in real-world projects.
At this point, many PHP developers think that can learn from ror design ideas, but should not copy the ROR structure and implementation. To do this, some frameworks that also promote rapid development begin to appear in the PHP community. In these frameworks, CakePHP and Symfony are among the best.

CakePHP(http://www.cakephp.org/)
CakePHP is full of ror shadows, and layout management from ActiveRecord mode to view is very similar to ROR. And CakePHP initially tried to implement many of the same things as Ror. But CakePHP's development team later discovered a huge difference between the PHP language and the Ruby language, so many of the designs in Ror, even if they could be implemented in PHP, lacked practical value.
CakePHP gradually emerged from the shadow of Ror in the development and began to explore the architecture and implementation of the advantages of the PHP language itself. So there was a time when CakePHP's API changed dramatically, so that other developers stopped waiting.
However, due to the unreasonable structure and too much imitation of ror, the core of cakephp is becoming more and more difficult to understand and the performance is unsatisfactory. And CakePHP takes a huge database manipulation object as the basis for all business objects. While this facilitates rapid development, it makes testing of business logic objects very difficult.
For smaller projects, CakePHP is ideal. Excellent rapid development capabilities, rich APIs and detailed documentation all help developers get the job done quickly. But as the size of the project increases, CakePHP's limitations become prominent.

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

Business interests and the Boulevard to Jane

After seeing the potential commercial value of the PHP development Framework, Zend.com co-IBM announced that it would launch a development framework that would really unleash the benefits of PHP. For a time, the message caused an earthquake in the entire PHP community. Everyone began to look forward to this "official" background of the development framework can be a PHP developer to point out the right path.
But the world is unpredictable, and as soon as the Zend Framework team publishes several snippets of code, it is immediately possible for developers to point out that these snippets are impossible. It turns out that these snippets are just good ideals. Limited to the capabilities of the PHP language itself, the Zend framework ultimately did not implement the implementation of the ActiveRecord model that was promised in the Ror.

Zend Framework(http://framework.zend.com/)
The Zend framework uses a large number of new object-oriented features in PHP5: interfaces, exceptions, abstract classes, SPL, and so on. The application of these things has made the Zend Framework highly modular and flexible. At the same time, because of the strict adherence to the "interface Programming" and "single object responsibility" principles, so that the Zend framework is very promising to become an excellent enterprise application development framework.
Unfortunately, the Zend Framework has not made any more breakthroughs today. When using the Zend Framework development, the framework does not provide any help to the domain logic separation that is most important to the application itself. If you want to develop a truly robust enterprise application, you still need to make considerable effort from the developer and build your 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, does not translate these advantages over 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, the developers put forward higher requirements, the indirect increase in project development costs. For larger projects and enterprise applications, the Zend framework is a good foundation. But to create a successful application, it still takes a lot of effort. And always pay attention to the performance problems of Zend Framewok.

Code igniter(http://www.codeigniter.com/)
Code Igniter can be said to be a dark horse. When Code Igniter appeared, it was the time Symfony and cakephp Zend the framework to look forward to. With unique design ideas, Code igniter attracts a large number of developers. This is confirmed by its fiery official forum.
Code igniter The principle of "simplicity is beauty". There is no fancy design pattern, no ornate object structure, everything is so simple. A few lines of code can start running, and a few lines of code can be used to output it. Most of what is used in daily development can be found immediately, and can be easily used. Code Igniter is a model of "Boulevard to Jane".
However, the implementation of Code igniter itself is not ideal. The internal structure is too chaotic, though simple to use, but lacks the ability to expand. Thus, when developing to the 1.5 series, the authors had to extend the framework by adding a variety of hooks.

Domestic PHP Development Framework

Domestic Although some developers have published frameworks in the past, these frameworks are either too simplistic or tightly coupled to one type of application and lack commonality. Until the 2006, with the large number of PHP in the domestic application and popularity, the real domestic PHP development framework has been released in succession.

FCS (http://fcs.org.cn/)
FCS is a Chinese PHP development framework ported from the struts structure of Java, Using the object-oriented development structure and the MVC model, and simulating the implementation of the Struts tag library, drawing on some foreign good ideas, especially Java framework, so familiar with Java developers relatively easy to get started, its template engine, caching mechanism, authentication mechanism and extensibility are very uncommon.
in the reference to foreign outstanding ideas, FCS also considered the domestic application development needs. PHP4 compatible, fully support UTF-8, and pathinfo support, etc., more conducive to domestic host environment and development needs. With easy-to-use and extensible principles, FCS uses easily understandable projects, modules, and operating mechanisms coupled with built-in automation to make application development easier, and its capabilities can be expanded flexibly in the form of base class libraries and various plug-ins to meet growing business needs. Because of the good development structure, FCS does not appear to have many obstacles in the development of large-scale applications, and the component-based approach, as well as the project management mechanism with the framework, also allows you to work on large applications.
FCS strives to streamline the code and the whole culture of the document, comments, for the domestic PHP developers to learn and master, but according to the current situation, the official document and community support is still relatively short, and the support of Ajax 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 was the first truly mature, stable development framework launched by the authors from the PFC1 to the PFC3 series and FLEA1 test framework.
Unlike many other frameworks, the fleaphp design is based around two priorities for rapid development and full utilization of PHP's own strengths. Therefore, the most important feature of fleaphp is the high degree of modularity and expansion capability.
The core of the fleaphp framework is very small, but with a flexible configuration, various types of infrastructure can be combined. For a simple script page, fleaphp does not need to load the MVC pattern, only to provide business logic and database services to the application. For complex applications, fleaphp can perform a variety of tasks, from MVC mode invocation, access control, data validation to file upload, image processing, and more.
Thanks to this excellent customization and scalability, fleaphp is truly close to the goal of "meeting the needs of simple applications 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 promotion sites to complex community sites, enterprise internal systems and more.

Fleaphp as a fully domestic framework, with full Chinese culture of documentation, code comments, and in the extended function also focus on the actual needs of domestic developers. Therefore, compared to foreign frameworks, fleaphp is more easily accepted by domestic developers.
However, because it is at home, fleaphp faces much more difficulties than foreign counterparts. The lack of enough contributors, rude accusations, and skeptical glances all make fleaphp's development team members need more dedication. And because of the lack of sufficient contributors, the fleaphp framework currently has a large gap in terms of documentation and extended functionality compared to other mature frameworks.
And, like all other PHP development frameworks, fleaphp does not find a way to help developers separate the application domain logic. Although there are guidance documents, it can be useful for a novice developer to use a domain logic base.

Reflection and enterprising

Ror's shock wave is far from over, but PHP developers are already starting to rethink whether the pace of Ror is really a qualitative change for PHP development.
ROR has been able to achieve such a great success, in addition to Ror's own design ideas, there is an important reason is that ror fully utilize the language of Ruby's expertise. Bring the benefits of Ruby's dynamic language to the fullest. In PHP, if you simply copy the Ror design, you have to meet the limitations of the PHP language itself everywhere. In order to circumvent these restrictions, developers have to use some hard-to-understand techniques to solve problems. However, this often results in the structure of the framework becoming obscure and impaired in performance.
In this reflection, Code igniter, fleaphp and other frameworks are the best answer to this question. Only by taking advantage of the PHP language itself can you really make PHP development easier and more interesting.

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

In the future, PHP will become a more and more important platform in the field of web development. So we believe there will be more and better frameworks for development. Although, as a developer, it is not necessarily necessary to adopt a framework to solve the problem. But because of these emerging frameworks, our understanding and grasp of developing Web applications using PHP has been driven over and over again.

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

PS: The original author of this article is one of the fleaphp developers. Thank for its contribution to the domestic PHP

http://www.bkjia.com/PHPjc/317982.html www.bkjia.com true http://www.bkjia.com/PHPjc/317982.html techarticle the current situation and prospect of PHP development Framework Introduction: With the popularity of Ruby on Rails, PHP, the popular Web application scripting language, has also seen a lot of new development frameworks. At the same time, domestic ...

  • 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.