[Catalyst] Setting the Catalyst Request object
Bill Moseley
moseley at hank.org
Thu Dec 13 17:55:30 GMT 2007
On Thu, Dec 13, 2007 at 10:09:39AM -0500, Christopher H. Laco wrote:
> Bill Moseley wrote:
> > Yesterday I needed to add JSON support (both in the request and
> > response) to a few actions. I decided to try Catalyst::Action::REST.
> >
> > Well, actually, I first tried using just C::A::Serialize and
> > C::A::Deserialize -- but was not sure if those could be used
> > separately. That didn't work so then I just tried using the full
> > REST setup as described in the calendar.
> >
> > Well, that brings in C::Request::REST, which set the request object,
> > and I already have C::P::Server which does the same thing.
> >
> > Is there a way that multiple add-ons can work better together when
> > they need to add methods to the request object?
> >
> >
>
> I would think you could beat them at their own game. Make your own
> subclass, which inherits from both of their Request subclasses. Then,
> just have Cat use yours instead.
Yes. But I'm wondering if there can't be a defined approach so that
module authors don't have to worry about stepping on other modules.
I guess it depends if you want to override or just extend the existing
Request class.
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list