Zend Framework 2

IT'S A THING!


Brian Scaturro
@scaturr
github.com/brianium

SHAME(FUL/LESS?) PLUG 


coLearning at The Factory with yours truly
DO IT!

Zend framework 2 (Zf2)

Like any framework, ZF2 is an implementation detail.

Don't put all your eggs in one basket. Frameworks don't solve domain problems. You solve domain problems.

ZF2 IS:
  • A collection of components that can be used independently.
  • A collection of components that can be used together to make applications (web/console).
  • An event driven MVC framework (Zend\Mvc).

Strong points

ZF2 is definitely built for web applications. There are classes for console applications, but meh.

Great object-oriented design (SOLID), coupled with an event-driven architecture makes ZF2 all kinds of extensible.

Modular. The module is a cornerstone  of a ZF2 application. Pick your poison: http://modules.zendframework.com/

Strong Points CONT'd

The points made on the website are actually pretty fair:

ZF2 Components in your non Zf2 apps


 +  = OK

 


WEAK POINTS

SOOOOOOOOOOOOO MUCH CONFIGURATION:


This definitely contributes to a slow start, and can be a bit of a learning curve.

WEAK POINTS CONT'd

Testing is pretty cumbersome. 

UPDATE: Zend\Test has been released and has made controller testing quite a bit easier.

The bootstrapping process requires some boilerplate code, but the addition of Zend\Test\AbstractHttpControllerTestCase has made the overall process more enjoyable.

MOAR WEEK POINTZ

Compared to other mature PHP frameworks, ZF2 is pretty lacking in the tooling department. 

What we have is ZFTool. As of this presentation ZFTool is little more than a project scaffolding tool. It's a start, but someone with a little command line knowledge could do as much,  if not more.

No support for migrations, models, or anything database related.

SUMMARY

ZF2 components can make there way into your non ZF2 applications because of a pretty solid modular design.

The MVC component is more than capable of creating performant web applications. 

The components are definitely useful and efficient.

Getting started with ZF2 can be a little slow,  and there are a lot of configuration factors to wade through. 

The provided tooling leaves much to be desired.


ZF2 may not be the right choice for getting a product to market quickly, but it is definitely a good choice for business critical applications that will be around for a while. 


Check out an example of a simple app using ZF2 components inside of a Silex application, as well as a ZF2 web application leveraging the full ZF2 MVC stack.


https://github.com/brianium/zf2-overview

Zend Framework 2

By Brian Scaturro