Skip to main content
Image for post: What's new on Zend framework 2

What's new on Zend framework 2

ZF2 framework features

As you know Zend 2 is very different from the first version. Let's start with this amazing answer on stackoverflow. Architecture ZF1 is based on MVC , ZF2 is based on MOVE. Huge difference. MOVE = Model Operations Views Events , MVC = Models Views Controllers.

  • Models: it contains the application status and its informations ;
  • Operations: they are associated to the functionalities;
  • Views: they give the interface for the user and application interaction reading the Models data;
  • Events: they join the different componets securely.

Zend Framework 2 uses 100% object-oriented code and utilises most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures. It's on github and you can download the Skeleton Application as an example. Inversion of Control is used on Dependency Injection.

Autoload

Size of installation The latest ZF1 file is approx 30Mb and ZF2 is approx 2.5Mb (zipped). Small project, especially on shared hostings will be handled in a better way! Dependency ZF1 is core set of libraries and very loosely coupled architecture (with respect to its competitor/player - CakePHP). ZF1 does not require much of 'gems' (as in ruby) but, can do better with plugins. ZF2 requires you to know about pyruscomposer - phar and soon it may out-match any other framework. New concept : Dependency Injection for Zend fans.

Event Manager

It handles events on MVC architecture.

  • bootstrap, which initialize modules with various configuration files
  • route, which handle URL and code to follow. It act as a controller
  • dispatch, the execution: the application follows the business logic and it gives the view with the template on output

Certification Certification is available only for ZF1, however, there are rumours about their talks for ZF2 certs though training material is available online. Conventions classname in ZF1 was Zend_Db_Table for class in Zend/Db/Table.php whereas in ZF2, it is class My\Auth\Adapter . Enough said. Community ZF1 was backed by Zend Technologies (and few other, unnamed). ZF2 has remarkable supporters including Google and Microsoft. Speed It took approx 20 times more time to execute "Hello World!" in ZF2. I am not judging here. I could be wrong here. DIY. Which one should I opt for? MVC is been around since almost a decade and if you are one of them who are feeling sad for a new architecture altogether then hey! IT is 'your chosen' domain, keep up with the trends and update yourself!

Share this post

This website and/or any sub domains use cookies to understand how you to improve your experience.