php[architect] logo

Want to check out an issue? Sign up to receive a special offer.

Zend Framework 2.0 Taking Shape

Posted by on March 11, 2010

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.

Marco is the keeper of keys and Chief Garbage Collector at Blue Parabola. He can be found on Twitter as @mtabini.
Tags: , ,

Responses and Pingbacks

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

Has it been confirmed that ZF 2 is going to integrate Doctrine 2?

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.

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.

[…] 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 […]

I hope Doctrine 2 can be easily integrated in ZF 2 with less configurations.

Doctrine 2.0 integration would be so great.

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.

[…] 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 […]

Leave a comment

Use the form below to leave a comment: