[Catalyst] So, what things make Catalyst cool for you?

Sebastian Riedel sri at oook.de
Sun Oct 30 22:42:09 CET 2005


Am 30.10.2005 um 22:02 schrieb Sam Vilain:

> On Sat, 2005-10-29 at 23:14 +0100, Pedro Melo wrote:
>
>>> 1. The method to uri mapping is just awesome. :)
>>>     sub foo : Path('/index.html') {}
>>>     sub foo : Global {}
>>>     sub foo : Local {}
>>>     sub foo : Regex('^(.*)\.html$') {}
>>>
>> this is one of the best things. It makes a very clean code base with
>> enforced separation of actions per method.
>>
>
> It also could make finding entry points for a given path very hard  
> in an
> application which is "somebody else's".
>
> How is resolving this typically solved on a Catalyst code base?  Do  
> you
> compile the app and ask it for its URI mapping, or simply "try to keep
> it under control" ?
>
> In my own URI to handler mapper (on CPAN as PSA::Cache), I use a
> convention that mirrors CGI in style - URIs simply get resolved to
> relative pathnames, with path_info and "index" feature  
> equivalents.  In
> this instance, I preferred convention over flexibility.  It did  
> have its
> drawbacks; for instance moving paths around was often a PITA.  But it
> sure was simple to explain and understand.

The log output of a simple myapp example should explain it. :)


odyssey:~/MyApp sri$ script/myapp_server.pl
[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Debug messages enabled
[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Loaded plugins:
.----------------------------------------------------------------------- 
------.
|  
Catalyst::Plugin::Static::Simple                                         
     |
'----------------------------------------------------------------------- 
------'

[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Loaded dispatcher  
"Catalyst::Dispatcher"
[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Loaded engine  
"Catalyst::Engine::HTTP"
[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Found home "/Users/sri/ 
MyApp"
[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Loaded components:
.----------------------------------------------------------------------- 
------.
|  
MyApp::C::Foo                                                            
     |
'----------------------------------------------------------------------- 
------'

[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Loaded Private actions:
.-------------------------------------- 
+---------------------------------------.
| Private                              |  
Class                                 |
|=------------------------------------- 
+--------------------------------------=|
| /default                             |  
MyApp                                 |
| /foo/bar                             |  
MyApp::C::Foo                         |
'-------------------------------------- 
+---------------------------------------'
[Sun Oct 30 22:39:32 2005] [catalyst] [debug] Loaded Path actions:
.-------------------------------------- 
+---------------------------------------.
| Path                                 |  
Private                               |
|=------------------------------------- 
+--------------------------------------=|
| /foo/bar                             | /foo/ 
bar                              |
'-------------------------------------- 
+---------------------------------------'
[Sun Oct 30 22:39:32 2005] [catalyst] [info] MyApp powered by  
Catalyst 5.49_02
You can connect to your server at http://odyssey.local:3000


--
sebastian




More information about the Catalyst mailing list