[Catalyst] Class::DBI::Loader borging too much too fast?
Andy Grundman
andy at hybridized.org
Wed Jul 6 20:18:27 CEST 2005
Dominique Quatravaux wrote:
> Also, I'm afraid that saying "use MyApp::M::Foo" in a piece of code
> outside the Web app (e.g. a cron script) is not going to work, because
> the Class::DBI::Loader singleton has to be created before the
> persistence part of MyApp::M::Foo will work (see my earlier thread
> "Initialization ordering, how?" starting at
> http://lists.rawmode.org/pipermail/catalyst/2005-June/000769.html ).
> And of course, a model class without the persistence is much less fun.
> In other words, MyApp::M::Foo doesn't correctly encapsulate it's
> persistence aspect.
>
> To close the two issues at once, I'd like Class::DBI::Loader->new() to
> refrain from borging everything at startup, and be taught to borg
> piecewise and when requested. I'd like to be able to say:
Since you seem to have some fairly complex requirements, you may just
want to stop using Loader completely. I don't use Loader in any real
applications myself, and prefer to create my model classes manually so I
can have more control over my relationships, especially many-to-many
relationships which aren't handled by Loader. Also, you don't need to
inherit from Catalyst::Model::* if you don't want to, and not doing so
will enable your classes to be used without hassle in a non-Catalyst
cron job for example.
-Andy
More information about the Catalyst
mailing list