[html-formfu] what is the use of InstancePerContext in HTML::FormFu ?

Carl Franks fireartist at gmail.com
Mon Mar 9 10:25:44 GMT 2009


2009/3/9 Francesc Romà i Frigolé <francesc.roma at pharos.cat>:
> I'm looking at the source code of Catalyst::Controller::HTML::FormFu and I'd
> like to know what the module Catalyst::Component::InstancePerContext is used
> for.
>
> I've read that Jonathan Rockway advises against this technique here:
> http://search.cpan.org/perldoc?Catalyst::Component::ACCEPT_CONTEXT
>
>> The best strategy, though, is not to use the context inside your model.
>> It's best for your Controller to pull the necessary data from the context,
>> and pass it as arguments:

"inside your model"

Catalyst-Controller-HTML-FormFu isn't a model.

Custom constraints / validators are the main thing that may need
access to the context, where it's not possible to pass it as an
argument.
I don't know why InstancePerContext is better than ACCEPT_CONTEXT, "I
just used it because mst said to"™ ;)

Carl



More information about the HTML-FormFu mailing list