(on Wednesday, 17 December 2008, 11:00 AM -0500):
> I have an application that I have been working on for quite a bit now. The way
> I structured it was to create a bootstrap file which contained a class with
> static properties and attributes. Those are for instance the registry,
> configuration file, the front controller etc. The run() function of the static
> class runs the application by initializing the environment, setting up the
> registry, logger, db etc.
>
> I decided to use the Zend Studio for Eclipse wizard to create a new ZF
> application. Interestingly enough the structure of the project created was
> identical to the one I have already created but the bootstrap process is
> different. In that skeleton structure the bootstrap file creates the front
> controller, registers a plugin (Initializer extending
> Zend_Controller_Plugin_Abstract) and starts the application. The plugin in turn
> is the one responsible for all the init work (database, routes, views etc.).
>
> My question is whether one method is better than another. Why should I use a
> plugin instead of a static class?
>
> Comments/pointers/thoughts are more than welcome.
Statics are harder to test against and usually show that you are trying
to group unrelated tasks.
That said... you may be interested in the Zend_Application proposal,
which will be our recommended way to bootstrap your applications. You
can find it on the wiki:
http://framework.zend.com/wiki/display/ZFPROP/Zend_Application+-+Ben+Scholzen
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论