Zend Framework 2.0 Taking Shape
There’s been lots of buzz about Zend Framework 2.0 recently, and for good reason: the feature list is truly kick-ass. With dozens of proposed changes, the second iteration of the web’s most popular framework is looking to be considerably better, more efficient and easier to use than the first, while still offering the functionality that framework users have come to expect.
Some of the most noticeable changes are planned for the way objects are handled. First and foremost, Zend Framework’s authors have decided to eliminate many if not most of the singletons throughout the framework. This change will considerably improve unit testing as well as improve the overall design. Second, the framework will employ “design by contract” – using interfaces to develop APIs for various components. The design by contract paradigm helps improve API consistency, and the framework’s consistency will be overall improved.
Zend’s team will also unify the constructor for each class, making the first argument take an instance of Zend_Config. This will allow configuration options to be passed nearly universally, as well as allow for easier dependency injection and the introduction of “named” arguments.
Another significant change will be that Zend Framework 2.0 will require PHP 5.3. This is because it will make use of namespaces, as well as (very) sparing use of goto for certain applications. Furthermore, it will autoload all components, which improves performance and eliminates dependency problems (especially for exceptions). The framework will also make use of the __invoke() magic method and closures.
One consistent complaint being addressed is the request time for Zend Framework requests. Other frameworks, especially micro frameworks, greatly exceed Zend Framework’s ability to handle requests; some refactoring in 2.0 will help reduce and improve the request time and performance of the framework’s MVC components. These improvements are necessary, as Zend Framework can bog down under heavy load.
The improvements offered are not yet set in stone; they may change as Zend refines and further identifies the areas where the framework needs improvement. But the current list is fairly extensive, and when implemented, will represent a great step forward for this already awesome framework.
Leave a comment
Use the form below to leave a comment:
Responses and Pingbacks
March 11th, 2010 at 4:36 pm
Actually, the decision to have a unified constructor is up in the air. There have been some well-reasoned arguments against the practice, and we are considering only applying the “unified constructor” in specific instances (specifically plugins, helpers, and adapters).
March 21st, 2010 at 4:08 am
Has it been confirmed that ZF 2 is going to integrate Doctrine 2?
March 22nd, 2010 at 7:36 am
Eddie, after talking with Matthew Weier O’Phinney, it has become more clear that much of that document is still up in the air. I think Doctrine 2 integration will largely depend on the release dates of both the framework and the ORM.
Since the document I linked is in progress, feel free to contribute to it or comment on it and tell them you want Doctrine 2.
March 28th, 2010 at 7:37 am
Thanks. I have just logged a comment. However, I am not the first, there are many other developers proposing the suggestion.
I already integrate the latest stable version of Doctrine with ZF 1.7 – 1.10, I can not recommend it enough.
June 7th, 2010 at 10:18 am
[…] news in regard to Zend Framework 2.0. The last time we discussed it on the php|a blog was back in March. However, this week saw the release of several new announcements from Matthew Weier […]
June 24th, 2010 at 8:48 am
I hope Doctrine 2 can be easily integrated in ZF 2 with less configurations.
October 18th, 2010 at 2:41 am
Doctrine 2.0 integration would be so great.
April 10th, 2011 at 8:46 pm
doctrine integration? Why in the world would you want some huge ass ORM integrated into Zend by default? It’s easy enough to do it on your own if you even need it! IMHO – raw queries are better, faster and more powerful.
February 4th, 2012 at 6:48 pm
[…] preferred choice for now because of the larger development community; however given the fact that ZF 2.0 was announced almost 2 years ago and they still haven’t managed to get it into release state, I believe that Symfony might […]