[Catalyst] instantiating persistent DBHs: MyApp.pm? Model?

Todd Harris harris at cshl.edu
Sun Jun 24 07:17:27 GMT 2007


Hi all -

I'm a newb to Catalyst and am trying to retrofit some code into the  
framework.  In particular, I'm debating about the best place to  
position some database handles.  Most of these have their own APIs,  
negating the need for something like CDBI or DBIx::Class;  others are  
for obscure oo-databases.

In the past, I've relied on persistence of globals under mod_perl to  
establish DBHs to these resources in a tradtional Perl module  
inheritance layout.   What might be the most appropriate for these  
under Catalyst?  Should I look to put methods that establish DB  
connections under MyApp.pm and stash the database handles in $c?   
Should I subclass Catalyst::Model instead?

Thanks in advance for insight.

Todd



More information about the Catalyst mailing list