[Catalyst] Re: Catalyst::Action::REST

Matt S Trout dbix-class at trout.me.uk
Mon Nov 27 16:02:23 GMT 2006


Garrett Goebel wrote:
> 
> On Nov 21, 2006, at 9:44 PM, Garrett Goebel wrote:
>> On Nov 21, 2006, at 9:16 AM, Matt S Trout wrote:
>>> Garrett Goebel wrote:
>>>> I tunneled PUT and DELETE inside a POST via a "_method" body 
>>>> parameter, which was automatically unravelled before dispatch within 
>>>> an overridden Catalyst::prepare_body_parameters method.
>>>
>>> Clever. Would you be willing to separate that out as a plugin with a 
>>> configurable parameter name? I think that might be well-received (and 
>>> actually something that *should* be a plugin for once :)
>>
>> I'll see what I can do. I'll be off the grid over the Thanksgiving 
>> holidays. But I'll take my laptop with me. There's a good chance I'll 
>> have the time, but with 4 kids under the age of 10, I can't make any 
>> promises ;)
> 
> On the ride home from the holidays, I managed to throw together my first 
> catalyst plugin module. That was, the easy part. Now I need to write the 
> tests and package it up for CPAN consumption.
> 
> 
> I'd like to invite criticism and comments now, before changes get more 
> painful.
> 
> For starters:
> 
> Is there a better package name?
> 
> Should I be inheriting from Catalyst::Base or Catalyst::Component? The 
> documentation says to use the former, but from scanning the code, it 
> looks like I only need the latter. On this one, I've stuck with the 
> documentation.

For a plugin, neither most likely.

> Should I be using Class::C3 for ->next::method instead of 
> ->NEXT::method? There are quite a few caveats in the Class::C3 
> documentation about not playing well with SUPER, but no mention of how 
> well it plays with NEXT.

Much though I despise it, probably NEXT

> Should I be using $c->config->{'Catalyst::Plugin::Request::Method'}? The 
> documentation seems to indicate this, but the existing plugin modules 
> seem to prefer shorter keys. Here I went with the preference for shorter 
> keys that seemed evident in the plugin modules I scanned. Easy enough to 
> reverse.

Acceptable.




More information about the Catalyst mailing list