[Catalyst] Shoot out -- Catalyst / RoR / Other MVC apps --
Bill Moseley
moseley at hank.org
Wed May 9 17:25:55 GMT 2007
On Wed, May 09, 2007 at 04:21:19PM +0100, Matt S Trout wrote:
> Most things that are currently plugins should, really, be either Controller
> base classes, models or helper objects that are handed to the template.
I guilty of this. Plugins have been an emphasized part of Catalyst
and, well, Cat makes them really easy to use.
I had some auth code I setup as a Controller base class and had my
Login controller inherit from it -- then it wasn't log before I wanted to
use that elsewhere. Stuffing common code in plugins sure makes it handy.
Often it's hard to figure out what's best until it's all built.
Speaking of plugins, I tend to use the common leading underscore for
"private" methods in plugins. Not very private. Not really a Cat
question, but do many people use lexical vars to store their private
methods in plugins?
my $private_method = sub { ... }
later:
$self->$private_method( $foo );
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list