Thinkphp,qeephp,cakephp,zendframework,symfony Comparison _php Tutorial

Source: Internet
Author: User
Demon that an excellent framework is not the only few business flows that can be done, it should be extensible,
Is rich, is a collection, is discrete. Simply say it is the paradox of all things, both free and convergent.

Volume Cut-In:

Frame Volumecake_1.2.2.81202.01mbqeephp-2.1.2116993kbthinkphp 1.5947kbzendframework-1.7.8-minimal16.1mbsymfony 1.2.511.1MB

Note: The above is to delete unnecessary files such as doc,test and other files after the minimum volume

A rough thought:

Domestic framework is generally relatively small, abroad is generally relatively large-。。 -It is not easy to think of small size as good here.


Directory structure:

thinkphp

On the left is the thinkphp directory structure,
Demon A cursory look at:
Common decentralized the runtime,
function library, universal file lang estimation is the core of the internal language
Lib/org is a number of common tools: Date,io,net,rbac,text and other lib/think under the core,
Focus on the MVC process plugin for the adapter plugin
Summary: It's really too small,
I saw it all at once.
Demon from the perspective of beginners to analyze the thinkphp process:
Initialize loads the necessary files, several classes under the Common,core,
You can call the new app (),
Then the whine ran with Init.
Guess the instantiation of Diapatcher in the app and call a method like run,
Start the action routing.

qeephp

Look at the directory structure of Qeephp,
Very comfortable,
The level is clear,
Each folder corresponds to a functional domain.
And each file has its corresponding exception.
command-line shortcuts to note in particular,
The behavior under extend is a bundle of behavior on the model.
Can be said to be decorate mode.
In the qeephp, some design patterns are used to meet the extensibility
Single responsibility.
qeephp Start-up mode:
I couldn't find it for a while.
This is due to the benefits of a single responsibility.
Refer to the official documentation:
See:
Get application startup information
$app _config = require (DirName (__file__). '/.. /config/boot.php ');
Loading the qeephp framework and application objects based on the settings in the startup information
Require $app _config[' Qeephp_dir ']. '/library/q.php ';
Require $app _config[' App_dir ']. '/myapp.php ';
Constructs an Application object and starts the MVC pattern
Echo myapp::instance ($app _config)->dispatching ();
Very comfortable.
But the streamlining is not enough,
In particular myapp.php and the following myapp::instance ($app _config)->dispatching ();
The relationship is very uncoordinated. (I think the author's intention is to want to multi-portal multi-application and Deployment mode,
But the portal should not be aware of the file name, but the perception index)
Like what:
Loading the qeephp framework and application objects based on the settings in the startup information
Require $app _config[' Qeephp_dir ']. '/library/q.php ';
Get application startup information
$app _config = qee_app::getconfiguration ("MyApp");
Constructs the Application object,
and start the MVC pattern
Qee_app::createinstance ($app _config)->dispatching ();
So not better.
No cumbersome manual loading,
Just know which app name you want to run.
Summarize:
It can be said that qeephp from the current directory structure to see,
can be studied.
There are, of course, some problems.
Comprehensive look qeephp in the directory structure than thinkphp good

Cakephp

Cake's catalogue is interesting:
An empty app project directory.
Then the core of the 4 Cache,controller,model,view is really mvc ah ...
Very simple, too simple,
CakePHP provides the CLI to initialize a basic MVC application.
So the starting mode is similar to qeephp.

Zend

Zend had to use a thumbnail,
It's too much, it's all too big.
The Zend is clearly clear,
Clearer than Qeephp,symfony,
And very full.
The feature is that folders can accomplish certain tasks in a single
This allows all classes to be split out individually,
Outside of the PHP file is implemented encapsulation,
and the corresponding directory is the class that the class contains,
Combined using a combination of patterns.
Zend is not familiar with the starting mode.
But it should not be bad.

Symfony

The structure of the symfony is also relatively clear,
But its granularity is finer than that of Zend.
It separates the controller,response,request.
But the whole line is inferior to Zend,
Not full,
is not discrete enough.
Some components of the symfony,
There is a certain dependency.

Summarize:

Judging criteria:

1. Is the directory hierarchy clear?

2. Whether the meaning of a directory communicates with its inner class is consistent '

3. Directory structure Consistency

From the catalog, zend>symfony>qeephp>cakephp>thinkphp

Class diagram

thinkphp

Core class diagram, we can see a single inheritance, derived from base. Almost all classes in think are inherited from base

Util's class diagram, which looks all down from base. I use a simple hierarchical relationship to describe the structure of the thinkphp.

A base-centered, outward-emitting structure.

qeephp

Look at the root of the EA in the class diagram of a Q, how comfortable, and in other classes, he did not pattern for the pattern.

Look at the picture:

It is a good idea to see that there is no relationship between a single class and a class that is cited as context, which manages the application context. Because it should be borrowed from Symfony. will be analyzed later.

The class level of qeephp, can be said to be free, scattered.

Symfony

It took 8 minutes to generate the class diagram, and it was a huge

Remove the ORM Layer plug-in (Symfony mvc,m by plug-in support, propel or doctince)

The mechanism of applying the plug-in Symfony can change M flexibly.

is not associated with a single class, which is derived to enable the reading of different configuration files.

Symfony is used in many cases by derivation. Its configuration of the drive by Sfcontext to Unified Drive, Sfconfig Unified management. A good architecture, single duty, allows multiple classes to complete the business flow of MVC under the Sfcontext drive.

And Sfcontext is located in the Util, basic suite, that is, if you do not need to run the MVC pattern, it is necessary to not call Sfcontext dispatcher on the line of birds, create a runtime context, MVC or command line mode, depending on the method you call.

Elegant and simple, not messy.

A context class manages all the components that are needed under MVC.

Zend

The same elegant and simple, but also a context to manage everything.

Zend is bigger, the figure is not sent.

Cakephp

CakePHP every what to say. It's too weak. Demon put it in a thinkphp,qeephp,cakephp.

Time was pressing, and it took 3 hours to complete the preliminary comparison. Of course, the most suitable for their own is the best.

Symfony,zend is suitable for demon, then you will be the spectator.

Summarize:

http://www.bkjia.com/PHPjc/735141.html www.bkjia.com true http://www.bkjia.com/PHPjc/735141.html techarticle Demon that a good framework is not just a few business flows, it should be extensible, is rich, is a collection, is discrete. Simply said it is the contradiction of all things, both swim ...

  • Related Article

    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.