Zend Framework and the Use At Will architecture

I was doing some talking with some gentlemen last night over several adult beverages and fine tobacco products.  They worked for a partner of ours and had brought up an interesting point concerning Zend Framework.  It seems as though people who ask them about their product set and how it fits in with PHP were asking about Zend Framework and whether or not you had to use the whole framework to be able to integrate with their software.

Perhaps it has been said, but if not, here is something very important to know about Zend Framework.  It has a "use at will" architecture.  What that means is that you can use all of it or you can use none of it.  Or you can use anything in between.  Do you want to use Zend_Queue, but you don't want to migrate your application to Zend_Controller?  Not a problem.  Do you want to use Zend_Db but not Zend_Application?  No problem.

I think that the Zend Framework community has done a lot of things right.  But what I think they have done MOST right is to have optional coupling between components.  I cannot tell you how many times I have worked with applications where fixing them was going to be problematic because the framework they were using was far too rigid.  It's one of the reasons why I am most definitely NOT a fan of code generation beyond the initial class creation.  There is another way of saying it:

Zend Framework treats you like an adult.

With that freedom comes responsibility.  But because you are an adult (or pretending to be) YOU are in control.  Zend Framework takes you 80% of the way there.  Why not 90 or 95%?  Because that's where the non-repeatable part of the application OR where the effects of the law of unintended consequences are greater.  Kevin's framework observation: "The effects of the law of unintended consequences is inversely proportional to the developer's ability to work without a framework."  Going further than the 80% (yes, an arbitrary number) means that you start to quickly lose flexibility, and also, quite possibly, performance.  You should never, and I mean NEVER, use a framework without first knowing that you need to use a framework.  In other words, if you have never built an application without a framework you are doing it backwards.  The reason I love Zend Framework is because I have had to solve the problems it solves on my own, and it was not pretty.  ZF often solves those same problems, but does it in a more structured way, making my life easier.  But not only does it make my life easier, I understand WHY it makes my life easier.

What it really comes down to is that because of the decoupled archicture in Zend Framework you have the freedom to make the decisions that you need in order best architect your application.  People often sacrifice freedom for convenience.  With ZF you get to choose how much freedom you want and how much convenience you want.  I like that.

Related posts

One thought on “Zend Framework and the Use At Will architecture

  1. Thanks for the insight. I agree that loose coupling of components is great side of Zend Framework.

    I still think it has some issues like using static calls all over the place and not using interfaces. I was thinking recently on some ways to improve the structure of one of the apps i work on now and here are some thoughts if your care to have a look

    http://artur.ejsmont.org/blog/content/how-to-structure-a-zend-framework-application-and-manage-internal-dependencies

Leave a Comment