I too am all for keeping bootstraps small and uncluttered. We can all benefit from code portability, and this small helper will just provide that extra push. With the ever growing presence of conventions with which we set up our applications, I believe that things like this model-loader can be of use for us all.

While simply composing an app from pre-made modules may be something for the future, it should be something we work towards,
MF

Ralph Schindler wrote:
Bill Karwin wrote:

Following this, I have no problem loading models. Isn't this simpler than using another helper class? Am I missing something? However, I realize that in more complex apps, it may not be quite this simple.

Yep :)
If you are developing a modular and portable application, models will exist in the module directory. Like:
/application
  /user
    /modules
      /blog
        /controllers
        /models
        /views
      /default
        .... (so and so forth) ...
      /users
        .... (so and so forth) ...
      /forum
        .... (so and so forth) ...


So, given that senario, its hard to know at bootstrap time, all of the different paths to all the different modules. This helper allows you to create more portable code. Also, what if you don't want to use the autoloader for purposes of APC or Bytecode? This way, you are making (effectively) the include_once call that comes along with loadClass.

This also allows you to jumpstart your applicaiton with pre-fabricated functionality, and also allows you to "import" models from other modules at development time.

-ralph


--

Maurice Fonk

[EMAIL PROTECTED]
http://naneau.nl/

Scio me nihil scire

Reply via email to