Indeed Ralph

I've been envisioning a repository of 'modules' that developers could share with each other that could standalone. Like a forums module, a blog module, a generic login module, a feed generator module, a simple CMS table-editor module, etc...

So I download a module, untar it and drop it into my ZF site with a minimum of fuss. With components like these I can be reasonably sure that it is self-contained and references its own Models, Views, Helpers, etc without relying too much on what I've done with my bootstrap file.

May not happen soon but I do like the way ZF is shaping up to allow such a possibility.


Shahar Evron wrote:
I generally like the idea as long as it is kept optional. I personally
like to load models by defining a model path (eg. APP_MODEL_DIR)
constant in my bootstrap file, and then call
Zend_Loader::loadClass('User', APP_MODEL_DIR);

I completely agree with you there, and yes, it would be an optional component of course, and what you describe works well in non-modular environments.

whenever I need to. IMHO it's clean enough and super fast, and I don't
like the idea of loading an extra class and calling some methods just
for loading a model class.

ModelLoader becomes important for fulfilling the role of finding the path to models (usually based on some convention) that belong to an in-use component.

The requirements this component fulfills is

a) ability to allow modules to take control of the loading of models and model paths with the system

b) not require the bootstrap to be completely aware of all modules conventions and paths to models

c) ability to register paths on on-demand and when modules are in-use

d) use Zend_Loader::loadClass() so that autoloading is not required, thus allowing op-code caches better cacheability since LoadClass() results in a require_once. (theoretically).


That being said, I still think there is a lot of value in such a component.

-ralph

--

Simon Mundy | Director | PEPTOLAB

""" " "" """""" "" "" """"""" " "" """"" " """"" "  """""" "" "
202/258 Flinders Lane | Melbourne | Victoria | Australia | 3000
Voice +61 (0) 3 9654 4324 | Mobile 0438 046 061 | Fax +61 (0) 3 9654 4124
http://www.peptolab.com


Reply via email to