[Catalyst] New Root Controller in Catalyst 5.66

Matt S Trout dbix-class at trout.me.uk
Wed Mar 1 15:41:45 CET 2006


On Wed, Mar 01, 2006 at 06:16:49AM -0800, Bill Moseley wrote:
> On Wed, Mar 01, 2006 at 01:27:28PM +0000, Matt S Trout wrote:
> > On Wed, Mar 01, 2006 at 06:00:01AM +0100, Sebastian Riedel wrote:
> > > The application class was from the beginning just meant as a place to  
> > > interact with Catalyst "internals", load plugins, configure the app  
> > > and the like.
> > 
> > And of course, your $c for each request is blessed into that class by
> > default (unless you set __PACkAGE__->context_class to something else).
> 
> Is it expected that all extensions would be in the form of plugins?
> For common code that doesn't fit into plugins (or I'm too lazy to
> write a plugin for) I've been throwing it into my app base class.  Is
> that not considered a good practice?

Sticking assorted useful methods onto your context class (which currently
is also your appclass) is fine, although you might want to consider moving
some of them to a Catalyst::Request subclass and setting ->request_class
to get your app to use that (depending on what the method is).

Actions should really be in a separate Controller class so you aren't
polluting your app/context namespace.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list