[Catalyst] ActionClass vs. Moose Role?

Bill Moseley moseley at hank.org
Fri Aug 28 17:25:06 GMT 2009


I was starting to implement a custom ActionClass (similar to RenderView) and
then wondered if it would be better written as a Moose role.
Is there a reason to use one over another?

Last I looked, an action is limited to a single ActionClass (although it's
easy to deal with that), but depending on how it's done, could apply
multiple roles.

That is, one way would be to define the end() method in the role and not
even have it in the consuming controller class, or another would be to have
a end() stub
in the controller and and then use "before 'end'" in the role.  That way
multiple roles could be applied.

Any guidance here?

Is everything going to be a role at some point? ;)

-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090828/a0eb4=
a33/attachment.htm


More information about the Catalyst mailing list