Sunday, October 7, 2012

Which framework is best for you ?

List of most popular frameworks :

There are many other frameworks available, but these are most widely adopted by developers.

Each of these frameworks is built in PHP language, but they differ in their methods and libraries.


Each of these frameworks has been released as open source projects, which means that a lot of development work relies on community support. Tracking bugs, writing supporting documentations, and providing general support are tasks that involve developers like you.




ZEND FRAMEWORK

Zend Framework was arguably the first framework to be built for PHP. Its corporate sponsor, Zend Technologies, has a long history with the PHP language itself; its founders include two of the original authors of PHP, Andi Gutmans and Zeev Suraski. Much of what has made PHP one of the most popular web programming languages started with Zend Technologies and its contributions to the language. That being said, no wonder Zend Framework has had early success and continues to be a major player in the PHP frameworks market.

In terms of community support, Zend Framework has probably the largest online following of any of the PHP frameworks. Its documentation is extensive and thorough, and unofficial blogs and forums make it possible to get online support for just about any question. Code submissions to the core are passed through rigorous testing methods, which makes Zend Framework an incredibly robust framework. However, Zend Framework is much more of a large set of libraries than a lightweight MVC framework. For instance, its main library folder is almost 16MB, more than three times the size of Cake’s libraries. Getting Zend Framework off the ground requires much more customization and configuration, whereas Cake has adopted more of the “convention over configuration” paradigm. You could likely use Zend Framework with just about any PHP project, which I'll demonstrate in   tutorials.

Zend Framework has no single development paradigm like Cake, CodeIgniter, and
Symfony, and that appeals to many developers. Patterns like MVC are therefore possible in Zend Framework, but these require you to manually write configuration methods, which are automatically built into Cake and other frameworks. Cake is certainly ahead of Zend Framework in how the framework cuts down the amount of code needed to extend it. Learning Zend Framework is generally more time-consuming than learning Cake, mostly because of the design of the framework. Getting an MVC variant of Zend Framework off the ground is usually more difficult for a beginner than Symfony, not to mention Cake.

True, Zend Framework is more well known than Cake in most PHP circles; it’s the veteran on the team, if you will. But Cake is proving to be more like the rising star that moves faster and is strategically sounder. Given Cake’s effective implementation of the MVC structure and its structural design, it will likely continue to attract former Zend Framework developers and remain the top player in the PHP frameworks arena.



CODEIGNITER


CodeIgniter’s community is relatively small when compared to CakePHP but does have a good support network online. Its user guide (www.codeigniter.com/user_guide) is well designed and has a nice layout for navigating through the table of contents. Many of the concepts used by Cake are also used by CodeIgniter, such as the MVC structure, helpers, routing, scaffolding, and caching. The support network is great, with a forum that boasts more than 66,000 topics and more than 400,000 posts. However, a lot of the topics there aren’t directly related to code development issues like Cake’s discussion group. In a sense, CodeIgniter’s forums and wiki are more like combining Cake’s discussion group, Bakery, and CakeForge. The number of websites built on CodeIgniter is smaller than that for Cake, but CodeIgniter is off to a good start and will likely become a more popular framework in the future.


Starting a CodeIgniter application takes less time than setting up a Cake application; however, some configuration methods that come preinstalled with Cake are left out with CodeIgniter. For example, setting up routes to behave like they do in Cake will require that you manually write an .htaccess file to pass paths through a similar routing engine. By default, CodeIgniter is more lightweight than Cake, which is one of its chief selling points. However, as you expand your CodeIgniter application, expect to have to perform an extra step here or there to achieve the same functionality you get from Cake.


The MVC structure in CodeIgniter is similar to Cake’s. Because of this, the general process of creating models, views, and controllers is nearly identical to what you learn when building Cake applications. Aside from minor differences in passing data around the application and naming conventions, running CodeIgniter is largely the same experience as in Cake. However, where Cake wins is with its powerful core classes, helpers, routes, and data-handling methods. The available resources and built-in functionality are more robust in Cake and, frankly, more cohesive. In other words, Cake developers will probably think they have taken a step backward when fully immersing themselves in CodeIgniter, though they will undoubtedly think they are in familiar territory. That’s not to say that CodeIgniter isn’t already a fabulous framework; it’s just that it separates methods into its several resources less effectively than Cake. In a nutshell, the Cake paradigm is more about making the model fat and spreading out the various methods; CodeIgniter makes for very large controllers.


SYMFONY

Symfony entered the PHP frameworks arena early on and has remained popular. Its community is also large with developers groups, forums, a chat room, a wiki, and more. All of the main links to these various online groups and sites are available on Symfony’s community web page (www.symfony-project.com/community).


After you have successfully begun a Symfony application, you will need to initialize your data source connections using the command line as well as perform other setup tasks. Generating the scaffolding is also done in the console, but the final result is similar to Cake’s scaffolding. Building models is primarily done using YAML-based configurations together with the symfony console script. If you prefer YAML to JSON or XML for configuring your database schema, then Symfony will probably suit you well. Cake really doesn’t compare in this regard because its methods for connecting to a data source don’t involve the command line (even though you can use Bake to write your database.php configuration file and build models).

When extending the Symfony application to take on more methods, many of the same concepts that make Cake effective are used. The learning curve is steeper when going from Cake to Symfony, mainly because the benefits Symfony offers are usually found in its command-line interface. However, Symfony users shouldn’t find learning Cake all that difficult. It may take some getting used to running fewer commands in the console, but on the whole, you shouldn’t have to perform any more steps to build your Cake applications than you would expect for a Symfony application.




CAKEPHP

Duplication throughout the community is kept to a minimum, so expect to be directed to a thread or blog post that someone has already used to address the same topic when asking a question or requesting support. You will also probably sense a feeling of perfectionism in the community. What I mean by that is this—the Cake Software Foundation, which manages Cake’s development, could have easily taken shortcuts when developing the framework. Compared to other frameworks, Cake would already be considered a version 3.0 or 4.0, but it’s currently at 1.2. This is due more to really tightening up the framework rather than cooking up something fast that could perform a large plethora of methods. The result of this strategy is that Cake really is more robust, mature, and well written than it otherwise would be, and you can count on it maintaining its robustness as it takes on more fancy methods.



Then "Which framework is right for me ?"

In each framework, you might notice powerful features than other framework, but selection of framework is always depends on which type of project you want to develop. Because, every framework has its own power to drive a site properly. In all framework powered sites, 60-65% site powered by Zend Framework, because of its beautiful and awesomeness.

To answer the question fully though, we really have to examine why we use a framework. Aside from the “two choices” scenario described above, programmers use a framework to simplify application development by providing much of the common code. A good framework will also enforce some structure on the code. However,  be wary of any framework that enforces rigid style conventions that you do not already adhere to. Your chosen framework should be flexible enough to adapt to the style and needs of your project.


The ultimate goal when selecting a framework, is to find one that allows you to work in a way that is natural to you, provides you the services that are most common to your application and allows you to concentrate on building the code business logic of your application.


To be fair though, the right framework for you is the one that lets you be productive quickest and leverage your new skills the longest.