[Catalyst] Mason + DBI + Catalyst?

Daisuke Maki lestrrat at gmail.com
Tue May 26 00:28:49 GMT 2009


>
> Do you write your queries using straight SQL? For my application, MySQL is
> a bottleneck. So it is important to me that I have control over the queri=
es
> to try to make them efficient. I don't have any query that spans 8 tables
> though. So if you are happy with DBIC, then it should be good enough for =
me
> too. I'll take a second look at DBIC.
>

I mix-and-match using DBIC and plain DBI calls, but I do it by completely
abstracting the model layer from DBIC.

instead of using Catalyst::Model::DBIC::Schema, I just create a
MyApp::Model::Whatever (or the equivalent thereof), so the actual data
munging resides in the Whatever.pm, and the user doesn't know anything about
the underlying framework being used.

so my controllers do something like

   sub foo :Local {
       my ($self, $c) =3D @_;
       my $data =3D
$c->model('Whatever')->load_data_using_really_complex_procedure();
       # do what you will with data
   }

Model::Whatever in turn just uses Catalyst::Model::Adaptor to delegate to a
Catalyst-agnostic "thing", which handles the actual data munging


--d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090526/1358c=
c42/attachment.htm


More information about the Catalyst mailing list