moltar has asked for the wisdom of the Perl Monks concerning the following question:
Storage:App::Model App::Model::User
Then I create an instance of the model in my app like this:App::Model::Storage::DBI App::Model::Storage::FlatFile
Then I'd like to be able to use the model like this:my $model = App::Model->new( storage => 'DBI', config => '...', );
So where I got stuck was sharing the config and storage information between the App::Model and App::Model::User class (and other children). What's the best approach? Are there any good modules to take a look at that implement something a similar way?my $user = $model->user->find_by_email(...); # finds user by email and + returns App::Model::User object $user->password('123456'); # change password $user->save; # save user profile
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sharing data between children modules
by Joost (Canon) on Dec 09, 2007 at 19:16 UTC | |
|
Re: Sharing data between children modules
by ian (Beadle) on Dec 10, 2007 at 17:54 UTC |