[Catalyst] setting up files and namespace for utilizing different models in the same catalyst app

Hermida, Leandro Leandro.Hermida at fmi.ch
Thu Nov 23 17:09:01 GMT 2006


Hello,
 
I am working through the tutorial and a question came to mind when
looking at the naming conventions used.
 
For DBIx::Class,
 
lib/MyAppDB.pm
lib/MyAppDB/Book.pm
lib/MyAppDB/Author.pm
lib/MyAppDB/BookAuthor.pm
 
Then for the Catalyst model,
 
lib/MyApp/Model/MyAppDB.pm
 
and in code,
 
$c->model('MyAppDB')->resultset('Book')->all;
 
What would people recommend as a naming convention and namespace setup
if one wanted to 
eventually use more than one model inside of the same Catalyst app?
 
would it be something like:
 
For DBIx::Class,
 
lib/MyApp/DBIC/Schema.pm
lib/MyApp/DBIC/Schema/Book.pm
lib/MyApp/DBIC/Schema/Author.pm
lib/MyApp/DBIC/Schema/BookAuthor.pm
 
For Catalyst,
 
lib/MyApp/Model/DBIC/Schema.pm
 
and in code,
 
$c->model('DBIC::Schema')->resultset('Book')->all;
 
 
Leandro Hermida
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20061123/59b2267e/attachment.htm


More information about the Catalyst mailing list