[Catalyst] Initialization ordering, how?
Bernhard Bauer
bauerb at in.tum.de
Thu Jun 30 16:24:24 CEST 2005
On 30.06.2005, at 15:40, Dominique Quatravaux wrote:
> Unfortunately just use'ing Foo::M::CDBI is not enough, it's singleton
> has to be initialized too just like Catalyst::Setup would do (in
> Catalyst::Setup::setup_components) in order for the persistence aspect
> of model classes to be initialized by Class::DBI. I dare not invoke
> Foo::M::CDBI->new() myself, as it would break singletonness (since
> Catalyst::Setup::setup_components is about to invoke
> Foo::M::CDBI->new() again once Foo::M::Bar is done loading).
I'm no Catalyst Expert myself, but if you 'use base "Foo::M::CDBI" in
your model class, it would load Foo::M::CDBI and not break
singletonness because then Foo::M::CDBI::new() is called with your
model class as first parameter, so it would just initialize this
specific model class and return the singleton for it.
HTH,
Bernhard Bauer
--
Bernhard Bauer
bauerb at in.tum.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4228 bytes
Desc: not available
Url : http://rawmode.org/pipermail/catalyst/attachments/20050630/9eee1256/smime.bin
More information about the Catalyst
mailing list