Michael Peters wrote:
I have also been working on something along this concept... I took a queue from Apache::Dispatch and Maypole which act as mod_perl handlers that then give the work to some controller class based on the path...
I'm currently calling it C::A::Dispatch. It based on the path it would create an instance of the correct class, give it the right run mode, and then run it...
I would be interested to see how you implemented this. Sounds really useful for some of the apps I'm maintaining.
So a request for something like this... /app/user_preferences/mode2
would be translated basically into these steps... require User::Preferences; my $app = User::Preferences->new(); $app->mode_param(sub {return 'mode2'}); $app->run();
How do you map path elements to the correct C::A class?
I really like it cause there are no instance scripts. I know somepeople really like instance scripts but to me they seem like clutter. I have found that if move all configuration directives into config files they are easier for non programmers to edit and then I don't need instance scripts.
I would be very happy with such a setup.
I don't know how much interest there would be from other people for something like this, but I'm willing to listen. Also, if there is a way for this to done in a normal CGI env (non mod_perl) then I'd be willing to do that as well if there was an interest. Maybe ... index.cgi?rm=user_preferences/mode2 or something like that...
Currently I resort to using mod_rewrite, doing stuff (roughly) like
RewriteRule ^/site/([^/]+) /cgi-bin/script.pl?rm=$1 [PT]
which works fine under mod_cgi too.
I can't think of a way to do without some form of instance script (or dispatcher) in a normal CGI environment though.
Rhesa
--------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
