NYCPHP Meetup

NYPHP.org

[zendframework] Is ZF becoming too insanely complicated?

David Mintz david at davidmintz.org
Fri May 15 12:17:23 EDT 2009


On Fri, May 15, 2009 at 11:31 AM, Michael Hernandez <mhernandez at techally.com
> wrote:
 [...]

> The autoloader changed a bit with 1.8 so that did cause some confusion.
> When you used to be able to say:
>
> require_once "Zend/Loader.php";
> Zend_Loader::registerAutoload();
>
>
> Now you have to...
> require_once 'Zend/Loader/Autoloader.php';
> $loader = Zend_Loader_Autoloader::getInstance();
>
> And then register your namespaces with calls to registerNamespace()
>
> It's a minor code change really, and it's worth it especially
> considering the increased flexibility of the new autoloader, but if you
> have a <1.8 app and you try to run it with 1.8 library code, you get
> yelled at. Actually in 1.8.0 you got yelled at too much so they scaled
> it back to 1 warning in 1.8.1.
>
> Now as for Zend_Tool and Zend_Application... totally not necessary, and
> in fact I found that after looking at the docs for those, I could spend
> X amount of time trying to grok those new additions, or I could leave my
> application-in-progress as is, and continue work as I was before. Right
> now I am revamping my ACL, and I really don't have time to consider
> redoing the way my app bootstraps, or learning how to make Zend_Tool
> write code for me.
>
> As far as I can tell, the parts you aren't so happy about are Zend_Tool
> and Zend_Application... the framework itself hasn't gotten more complex
> really. It's just got a couple of brand new components that (in my case
> anyway) would make my job harder and not easier (easier work... isn't
> that the point of the framework anyway? haha).
>
> FWIW, your application bootstrap might not need to be complex and object
> oriented like Zend_Application. In fact, my bootstrapping is done in a
> few lines, to load my config file and set up the auto loader, that's
> pretty much it. Aside from my main application I have a ZF XML-RPC
> server and that entire thing including the bootstrap (but not including
> the class containing the actual methods that are called) is about 15-20
> lines. Sure, it's not the most flexible bootstrapping, but it works and
> there's no reason for me to change it right now  - Zend_Application
> being released is definitely not a reason for me to break everything by
> trying to shoehorn it in :)
>
> Don't get caught up in the hype of new components, and the framework's
> benefits will shine through.
>

Points well taken. I figured out about the autoloader on Day One with 1.8,
that's not too big a deal.

As for the rest, yes -- I think I am a little prone to thinking there's an
obligation to master all the latest bells and whistles and shoehorn them in
whether I need them or not. Psychotherapy, anyone? Seriously, though, the
power of all that Bootstrap stuff is seductive. The use of _initFoo in the
bootstrap class that automagically stores the resource in the bootstrap,
that's just too cool. But do you really need it, if you were happily storing
globally-necessary things in Zend_Registry until now w/ no problems?
Especially considering that internally that's just what the bootstrap thingy
is doing, according to the docs.

-- 
David Mintz
http://davidmintz.org/

The subtle source is clear and bright
The tributary streams flow through the darkness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/zendframework/attachments/20090515/96594b60/attachment.html>


More information about the zendframework mailing list