Hi!
I'm playing around with Catalyst and a question came to my mind.
Let say you've got the following conf:
<Component Model::DB>
schema_class MyApp::DB
<connect_info>
...
</connect_info>
</Component>
and a second model that depends on the instance of the first one:
<Component Model::BM>
class MyApp::BM
<args>
schema_model DB
</args>
</Component>
Model::BM is a Catalyst::Model::Adaptor and in the prepare_arguments
method,
I do
my $schema_model = $c->config->{'Model::BM'}->{'
args'}->{schema_model} ;
- Ignored:
and get the schema model through $c->model($schema_model); to pass it to
my
BM constructor.
Surprisingly, this works, even if I put the Model::BM conf before the
Model::DB one in the conf file.
So my question is:
Is there a cleaner way to implement models that depends on others? In
which
order are the model instanciated? How can we control/enforce this order ?
Cheers!
Jerome.
--
Jerome Eteve.
http://www.eteve.net
[email protected]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/