[Catalyst] Setting the Catalyst Request object

Christopher H. Laco claco at chrislaco.com
Thu Dec 13 18:09:38 GMT 2007


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.
> =

> I guess it depends if you want to override or just extend the existing
> Request class.
> =

> =


I'd think the best thing would be for Request to be pluggable or
component-ized just like $c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071213/9b40=
0953/signature.pgp


More information about the Catalyst mailing list