[Catalyst] catalyst tutorial: MyAppDB/Book.pm vs. MyApp/Model/Book.pm

mla maurice.aubrey at gmail.com
Tue May 15 02:22:36 GMT 2007


I just finished getting the tutorial project working.

The thing I'm not clear on is this separation between lib/MyAppDB/
and lib/MyApp/Model/

The tutorial says:

"With Catalyst::Model::DBIC::Schema you essentially end up with two sets 
of model classes (only one of which you write... the other set is 
created automatically in memory when your Catalyst application 
initializes). For this tutorial application, the important points to 
remember are: you write the result source files in MyAppDB, but within 
Catalyst you use the automatically created model classes in MyApp::Model."

So using DBIC::Schema, I would never create anything within the
lib/MyApp/Model directory, other than the MyAppDB.pm module?

All the real models live in lib/MyAppDB? And if I wanted to use a
model *outside* catalyst, I'd use MyAppDB::Book, but within
catalyst it would be MyApp::Book?

Is this how most of you structure your projects? Is there a way
to get the real models in lib/MyApp/Model?

Thanks.




More information about the Catalyst mailing list