Home > Backend Development > PHP Tutorial > Current status and prospects of PHP development framework_PHP Tutorial

Current status and prospects of PHP development framework_PHP Tutorial

WBOY
Release: 2016-07-15 13:25:06
Original
731 people have browsed it

Ruby on Rails spurred changes

Before RoR became popular, there were many development frameworks in the PHP field, such as Mojavi, WACT, PHPMvc and Seagull. Although these frameworks also adopt technologies such as MVC pattern and database abstraction layer. But because PHP itself was not as popular as it is now, these frameworks were not widely used and eventually fell silent.

After feeling the rapid development capabilities provided by RoR, the PHP community seemed to be injected with stimulants. Various application technologies and development frameworks emerge in endlessly.

The birth of a new generation of frameworks

The PHP community did not fall into too much controversy after being stunned by RoR. Instead, we took action immediately and started the design of a new generation framework. The first frameworks that appeared first were almost all clones of RoR. For example, PHP on Trax (even the name is borrowed from Ruby on Rails), TaniPHP, Akelos, etc. The biggest feature of these frameworks is that they strive to 100% clone RoR, regardless of the architecture, design patterns, or usage methods.

These frameworks did attract the attention of developers at first, but as developers got to know them better, the halo over these frameworks gradually faded. Obscure architecture, poor performance, and too many limitations make these frameworks difficult to use in actual projects.

At this time, many PHP developers believe that they can learn from the design ideas of RoR, but they should not copy the structure and implementation of RoR. For this reason, some frameworks that also promote rapid development began to appear in the PHP community. Among these frameworks, CakePHP and Symfony are the best.

CakePHP

CakePHP is full of shadows of RoR, from ActiveRecord mode to view layout management, it is very similar to RoR. And CakePHP initially tried to implement many of the same things as RoR. However, the development team of CakePHP later discovered that there are huge differences between the PHP language and the Ruby language. Therefore, even if many designs in RoR can be implemented in PHP, they lack practical value.

CakePHP has gradually stepped out of the shadow of RoR in its development, and began to explore architecture and implementation that can better leverage the advantages of the PHP language itself. Therefore, for a period of time, CakePHP's API underwent drastic changes, causing other developers to stop and wait and see.

However, due to the unreasonableness of some early architectures and too many imitations of RoR, the core part of CakePHP has become increasingly difficult to understand, and the running performance is also unsatisfactory. Moreover, CakePHP uses a huge database operation object as the basis for all business objects. Although this is conducive to rapid development, it makes testing business logic objects very difficult.

For smaller projects, CakePHP is ideal. Excellent rapid development capabilities, rich APIs and detailed documentation can help developers complete their work quickly. But as the size of the project increases, the limitations of CakePHP also become prominent.

Symfony

Symfony is a very mature framework that makes extensive use of existing open source projects. 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 comprehensive support for Ajax. Coupled with the large amount of documentation and tutorials provided by the official website and having an active community, it is popular among many developers.

However, the biggest problem with Symfony is that it uses too many open source projects with different styles to form a framework. Since both Mojavi and Propel themselves are quite complex, Symfony's structure is very complex and difficult to understand and learn.

However, for companies that want to choose a framework as their internal system infrastructure, Symfony’s maturity, rich documentation, and active community are all worth considering. After all, enterprise internal systems value more stability and long-term support.

Commercial interests and simplicity

After seeing the potential commercial value of the PHP development framework, Zend.com and IBM announced that they will launch a framework that can truly take advantage of PHP. development framework. For a time, this news caused an earthquake in the entire PHP community. Everyone is beginning to hope that this development framework with an "official" background can point out the right path for PHP developers.

However, things are unpredictable. Just after the Zend Framework team released several code snippets, developers immediately pointed out that these code snippets were impossible to implement. It turns out that these code snippets are nothing more than beautiful ideals. Limited by the capabilities of the PHP language itself, Zend Framework ultimately failed to realize the implementation of the ActiveRecord model in RoR that it originally promised to provide.

Zend Framework

Zend Framework extensively applies new object-oriented features in PHP5: interfaces, exceptions, abstract classes, SPL, etc. The application of these things makes Zend Framework highly modular and flexible. At the same time, because it strictly adheres to the principles of "programming for interfaces" and "single object responsibility", Zend Framework is very promising to become an excellent enterprise application development framework.

But unfortunately, Zend Framework has not made any more breakthroughs until today. When developing using the Zend Framework, the framework does not provide any help in separating the most important domain logic of the application itself. If you want to develop truly robust enterprise applications, developers still need to make considerable efforts and build their own infrastructure on top of the Zend Framework.

In response to this point, critics pointed out that although Zend Framework has extensively applied the new features of PHP5, it has not transformed these advantages over PHP4 into something that can help developers.

For simple and small projects, Zend Framework not only cannot improve development efficiency. On the contrary, because a large number of object-oriented design and new features of PHP5 are applied in the framework, higher requirements are put forward for developers, which indirectly increases the development cost of the project. For larger projects and enterprise applications, Zend Framework is a good foundation. But creating a successful application still requires considerable effort. And always pay attention to the performance issues of Zend Framewok.

Code Igniter

Code Igniter can be said to be a dark horse. Code Igniter appeared at a time when Symfony and CakePHP were becoming popular and Zend Framework was highly anticipated. But with its unique design ideas, Code Igniter has attracted a large number of developers. This can be confirmed from its popular official forum.

Code Igniter advocates the principle of "simplicity is beautiful". There are no fancy design patterns, no fancy object structures, everything is so simple. It only takes a few lines of code to start running, and a few more lines of code to output. Most of the things you use in daily development are immediately available and easy to use. Code Igniter can be said to be a model of "great simplicity".

However, the implementation of Code Igniter itself is less than ideal. The internal structure is too confusing, and although it is simple and easy to use, it lacks expansion capabilities. Therefore, when developing to the 1.5 series, the author had to provide expansion capabilities for the framework by adding various hooks.

Domestic PHP development framework

Although some domestic developers have released some frameworks in the past, these frameworks are either too simple or inconsistent with a certain type of application. Tightly coupled and lacks versatility. It was not until 2006, with the large number of applications and popularity of PHP in China, that real domestic PHP development frameworks were gradually released.

FCS

FCS is a Chinese PHP development framework transplanted from Java's Struts structure. It uses object-oriented development structure and MVC mode, and simulates the implementation of Struts. The tag library draws on some good foreign ideas, especially the Java framework, so it is relatively easy for developers familiar with Java to get started. Its template engine, caching mechanism, authentication mechanism and scalability are all outstanding.

While learning from excellent foreign ideas, FCS also takes more into account domestic application development needs. PHP4 is compatible, fully supports UTF-8, and supports PATHINFO, etc., which is more conducive to the domestic host environment and development needs. Adhering to the principles of ease of use and easy expansion, FCS uses easy-to-understand projects, modules and operation mechanisms plus some built-in automated operation methods to make application development easier. Its functions can be implemented through base class libraries and various plug-ins. The form can be flexibly expanded to meet growing business needs. It is precisely because of its good development structure that FCS does not have many obstacles when developing large-scale applications. The component-based approach and the project management mechanism that cooperates with the framework can also allow you to show your skills when dealing with large-scale applications. long.

FCS strives to streamline the code and provide documents and comments in Chinese culture, which is conducive to the learning and mastering of domestic PHP developers. However, according to the current situation, official documentation and community support are still relatively lacking, and The support for Ajax is not comprehensive enough, so domestic applications are not mature enough.

FleaPHP

FleaPHP is a framework with a certain history from a development perspective. In the past three years, FleaPHP is the first truly mature and stable development framework launched by the author after releasing the PFC1 to PFC3 series and the flea1 experimental framework.

Unlike many other frameworks, FleaPHP was designed around the two focuses of rapid development and making full use of PHP's own advantages. Therefore, the biggest feature of FleaPHP is its extremely high degree of modularity and scalability.

The core of the FleaPHP framework is very small, but through flexible configuration, various types of infrastructure can be combined. For simple script pages, FleaPHP does not need to load the MVC mode and only needs to provide business logic and database services for the application. For complex applications, FleaPHP can complete a variety of tasks from MVC mode calling, access control, data verification to file upload, image processing, etc.

It is precisely because of this excellent customization and expansion capabilities that FleaPHP is truly close to the goal of "meeting various needs from simple applications to enterprise development". And unlike many other frameworks, FleaPHP is a framework that is completely refined during actual development. Therefore, with the development of FleaPHP, various practical applications have emerged one after another. On the FleaPHP official website, you can see a variety of practical applications. From the simplest corporate promotion website to complex community websites, internal corporate systems, etc., there are many.

As a completely domestic framework, FleaPHP has fully Chinese documentation and code comments, and it also pays attention to the actual needs of domestic developers in terms of extended functions. Therefore, compared with various foreign frameworks, FleaPHP is more easily accepted by domestic developers.

However, precisely because it is in China, FleaPHP faces many more difficulties than its foreign counterparts. A lack of contributors, rude criticism, and a skeptical eye all add to the need for more dedication from FleaPHP's development team members. And due to the lack of enough contributors, the FleaPHP framework currently lags behind other mature frameworks in terms of documentation and extended functionality.
And like all other PHP development frameworks, FleaPHP has not found a way to help developers separate application domain logic. Although there are guidance documents, for junior developers, a domain logic foundation that can be used immediately will be very practical.

Reflection and Progress

The shock wave brought by RoR is far from subsided, but PHP developers are already beginning to reflect on whether blindly following the footsteps of RoR can really help Does PHP development bring qualitative changes?

The reason why RoR has achieved such great success is that, in addition to the design ideas of RoR itself, another important reason is that RoR makes full use of the strengths of the language Ruby. Give full play to the advantages of Ruby dynamic language. In PHP, if you just copy the design in RoR, you will encounter the limitations of the PHP language itself. In order to get around these limitations, developers have to use some incomprehensible tricks to solve the problem. But doing so often results in the framework's structure becoming obscure and performance compromised.

In this reflection, frameworks such as Code Igniter and FleaPHP are the best answers to this question. Only by making full use of the advantages of the PHP language itself can PHP development truly become simpler and more interesting.

Today, although various PHP development frameworks have their own characteristics, almost all of them strive to improve development efficiency. However, although some of these frameworks have paid attention to the problem of improving application maintainability, none of them has proposed a solution to the crucial issue of domain logic separation. And this is exactly where these frameworks are going in the future.

For simple web applications and complex enterprise applications, the difference between the two means that a fixed architecture cannot meet the needs. Therefore, a framework like FleaPHP that can provide custom architecture capabilities allows developers to try different combinations of a framework to solve different levels of needs from simple to complex.

In the future, PHP will become an increasingly important platform in the field of web development. Therefore, we believe that more and better development frameworks will emerge. Although as a developer, you do not necessarily need to use a certain framework to solve the problem. But it is precisely because of these emerging frameworks that our understanding and grasp of using PHP to develop web applications has been promoted again and again.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/446712.htmlTechArticleRuby on Rails spurs changes Before RoR became popular, there were many development frameworks in the PHP field, such as Mojavi, WACT, PHPMvc and Seagull et al. Although these frameworks also adopt the MVC pattern and database abstraction...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template