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.
Thanks!
Nikolaos
--
The contents of this message may contain confidential or privileged information and is intended solely for the recipient(s). Use or distribution to and by any other party is not authorized. If you are not the intended recipient, copying, distribution or use of the contents of this information is prohibited.
The contents of this message may contain confidential or privileged information and is intended solely for the recipient(s). Use or distribution to and by any other party is not authorized. If you are not the intended recipient, copying, distribution or use of the contents of this information is prohibited.
没有评论:
发表评论