[Catalyst] change in Engine prepare_body_parameters

Bill Moseley moseley at hank.org
Sat Apr 28 17:50:40 GMT 2012

On Mon, Apr 23, 2012 at 5:55 AM, Tomas Doran <bobtfish at bobtfish.net> 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 f=
> 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 =3D> (
  is =3D> 'rw',
  required =3D> 1,
  lazy =3D> 1,
  builder =3D> '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 =3D> (
  is =3D> 'rw',
  required =3D> 1,
  lazy =3D> 1,
  builder =3D> '_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
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20120428/c908b=

More information about the Catalyst mailing list