On Fri, Nov 07, 2008 at 03:54:25AM -0500, Bill Moseley via RT wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=40733 >
>
> On Thu Nov 06 16:48:45 2008, mst@shadowcat.co.uk wrote:
> > Form validation should never be done via a plugin since it eliminates
> > code reusability across controllers using different form validators.
>
> Can you explain how using a plugin eliminates code reusability? Because
> $c->form ends up application-wide?
Right.
Show quoted text> Is it common for people to use different form validators in the same
> application?
It can be if people are trying to re-use components.
Also, plugins should only really be things that affect the request cycle
- ExtendingCatalyst.pod makes this clear.
Show quoted text> > Please rewrite this as Catalyst::Controller::Form::Processor in line with
> > how the FormFu and FormBuilder equivalents work and deprecate this
> > distribution.
> >
>
> Feel free to write a controller base class if you desire one. I wrote
> one for Form::Processor once and decided I liked the Plugin better. I
> guess I was too lazy to alter all my existing controller classes to
> inherit from it.
I don't use Form::Processor.
I'm filing this because the controller style is correct practice and we'll
be making a strong push at 5.80 to get people to stop using old-style stuff
that abuses the plugin system; I intend to provide a module that includes
a list of "poor practice" extensions and warns on startup if you're using
any of them, and this one will be on that list.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director
http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/