[Catalyst] RESTful perl implementations...

Matt S Trout dbix-class at trout.me.uk
Tue Sep 26 20:26:37 CEST 2006


John Napiorkowski wrote:
> --- Matt S Trout <dbix-class at trout.me.uk> wrote:
> 
>> Garrett Goebel wrote:
>>> On Sep 26, 2006, at 9:44 AM, Matt S Trout wrote:
>>>
>>>> Garrett Goebel wrote:
>>>>> I'm sure this is too late to be useful. But here
>> is my subclassed
>>>>> Catalyst::Action to implemented RESTful request
>> method based
>>>>> dispatching. [I've been working on this in my
>> free time. Which I have
>>>>> precious little of lately. My apologies.]
>>>>>
>>>>> The references to $c->request->path_parameters
>> are to support RoR
>>>>> style processing of urls (foo.com/person;create)
>> where
>>>>> Catalyst::Dispatcher->perpare_action is
>> overridden to match url paths
>>>>> separate from path parameters and file
>> extensions.
>>>>> I also override
>> Catalyst::Dispatcher->setup_actions to change the
>>>>> default method_action_class to my subclass of
>> Catalyst::Action. I was
>>>>> surprised that default method_action_class and
>> action_container_class
>>>>> appear to be hard coded...
>>>> These shouldn't need to be altered - the action
>> class for  
>>>> dispatchable actions
>>>> can be applied via :ActionClass or for an entire
>> controller via  
>>>> classdata.
>>> Perhaps it is a matter of taste, but I find
>> appending :ActionClass to  
>>> dispatchable actions to be clunky.
>>>
>>> Time permitting, I'll pour through the
>> documentation and code on how  
>>> to do that with "an entire controller via
>> classdata". Or if you can  
>>> point me directly to the relevant documentation
>> that would be greatly  
>>> appreciated.
>> package MyApp::Controller::Foo;
>>
>> use base qw/Catalyst::Controller/;
>>
>> __PACKAGE__->_action_class('My::Action::Class');
> 
> That's very useful to know.  Can this take a array or
> arrayref values?  From looking at Catalyst::Base I
> gather not, but it would be cool if you could
> aggregate action classes in some way.

Erm, no. It can't. See, we have this thing called "perl" :) -

package Aggregate::Action::Class;

use base qw/One::Action::Class Another::Action::Class/;

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

+ Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list