[Catalyst] Catalyst::Model::DBIC::Schema or not?
Brian Kirkbride
brian.kirkbride at deeperbydesign.com
Fri Mar 23 20:42:27 GMT 2007
Jason Gottshall wrote:
> Catalysters:
>
> I'm developing a new app using Catalyst, with DBIC as the db persistence
> layer. I intend to build Models that encapsulate the business logic and
> that will use DBIC to interact with the database as necessary, instead
> of using DBIC as a "model" itself.
>
> So if I'm not using DBIC from the controller directly, is there any
> reason for me to use Catalyst::Model::DBIC::Schema? It seems like I'm
> just adding an unnecessary layer of code.
>
> Comments from any of you who have a similar setup would be especially
> welcome.
>
> Jason
>
I only have Model classes for my business logic and have never had a problem
with that. A bonus is that it forces you to say:
$c->model('MyLogic')->_get_schema->resultset('Users')
instead of:
$c->model('Schema::Users')
and that makes you think about ugly hacks that circumvent your business logic.
More information about the Catalyst
mailing list