[Catalyst] How many models?

Jamie Neil jamie at versado.net
Thu Apr 26 22:02:24 GMT 2007

John Napiorkowski wrote:
> I think the consensus is that it's best to create business logic type
> models outside of Catalyst and then build a simple wrapper model for
> it.  That way you can use it for stuff like cron jobs and anything
> that doesn't live inside of Catalyst.

That's exactly what we're trying to do.

> Now I isolated the business logic for creating an account into the
> MyApp::Logic::Accounts package because for my system creating a new
> user is much more than just inserting a row into the Users database.
> The logic would using the MyApp::Schema::Users Class and some other
> classes and wrap all that into a neat interface.

Again, this is the direction we are going, however what I was concerned 
about was that this way we would end up with a lot more database handles 
that was necessary (we may have three or four models). Whilst this is 
not a problem for a single application, we are planning on running many 
instances sharing the same database server.

Of course I may just be misunderstanding how DBIx::Class works :)

Jamie Neil | <jamie at versado.net> | 0870 7777 454
Versado I.T. Services Ltd. | http://versado.net/ | 0845 450 1254

More information about the Catalyst mailing list