[Catalyst] Setting the Catalyst Request object
Matt S Trout
dbix-class at trout.me.uk
Sun Dec 16 22:39:45 GMT 2007
On Thu, Dec 13, 2007 at 09:55:30AM -0800, Bill Moseley wrote:
> 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.
Moose roles will fix that in 5.80.
--
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/
More information about the Catalyst
mailing list