On Mon, Apr 23, 2012 at 5:55 AM, Tomas Doran <[email protected]> wrote:
>
> On 21 Apr 2012, at 13:30, Bill Moseley wrote:
> > The code above looks like it was trying to fix some flow problems
> (populating the attribute directly as a hash, for example), so the real fix
> is probably something else. Perhaps a builder on body_parameters so that
> it isn't populated every call.
> >
> > This look like a bug?
>
> Yes, it does.
>
I just checked out from git and I see the code has been changed. It now
has a builder:
has body_parameters => (
is => 'rw',
required => 1,
lazy => 1,
builder => 'prepare_body_parameters',
);
Do you really want that to be the builder? "build_body_parameters" is
called directly in Catalyst::Engine. Wouldn't it be better to have
something like this?
has body_parameters => (
is => 'rw',
required => 1,
lazy => 1,
builder => '_build_body_parameters',
);
And then have:
sub prepare_body_parameters { return shift->body_parameters }
sub _build_body_parameters { ... }
That way the body parameters are only built once.
--
Bill Moseley
[email protected]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/