On Thu, Mar 4, 2010 at 9:25 AM, Brad Van Sickle <bvansick...@gmail.com> wrote:
> Tangential discussion on this... but what is the value in using
> dispatching modules like CAP::Routes and CGI::Application::Dispatch?


The big advantage for me when I decided to use CAP::Routes for a project
was because a route is a declaration of what the url looks like and it
will unpack
variables out of the url for me, instead of messing with PATH_INFO myself.

For example
       $self->routes([
             '/contacts/:action/?contact_id' => 'contact_create_update_delete'
       ]);

is describes the url better than:
$self->runmodes({ 'contact_cud' => \&contact_create_update_delete});

Especially when you are performing ajax queries and the like you want to know
what the url looks like and what runmode will be called.

Clayton

P.S. I've had great success in using CAP::Dispatch and CAP::Routes together
my instance script loaded a bunch of CGI::App based modules and used
CAP::Dispatch
to assign root urls for each module (/contacts, /staff, /etc) then I
used CAP::Routes to define the
different url/variable/runmode combinations within each Application.


-- 

Clayton Scott
clayton.sc...@gmail.com

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to