[Catalyst] Re: Multi-language and REST

Ashley apv at sedition.com
Fri Apr 25 17:20:49 BST 2008


On Apr 25, 2008, at 9:03 AM, Ian Docherty wrote:
>> I use Chained exclusively and don’t use the Perl package namespace  
>> as a mapping to the URI namespace at all, only for logically  
>> grouping related functionality. Usually the two still correspond  
>> to some extent of course, but I don’t feel any need to force a  
>> correspondence.
> I have considered that, but felt that with several developers a  
> 'hard rule' which mapped the
> Perl package namespace to URI namespace avoided potential chaos.
>
> I may reconsider in light of your comment. Would you care to give  
> an example of
> where you would choose *not* to map one-to-one?

I'm in the same camp for the most part. I'll have a  
Controller::Article but have its chain root be "a" for the short URIs.

You can also then have C::Admin::Article which doesn't dispatch to / 
admin/article but chains from /a/[id]/edit /a/[id]/preview /a/[id]/ 
rev/[#] and so on. Then a single auto method (if the setup is that  
simplistic) in Admin.pm can check authn/authz for everything in it.




More information about the Catalyst mailing list