> After some playing around, here is new API I've come up. Please comment and
> insult any piece that you wish :)
>
> CGI::Application::Dispatch->dispatch(
>   prefix => 'My::Project',
>   table  => [
>     ''               => { app => 'My::Project::Start', rm => 'start' },
>     ':app/:rm'       => { },
>     'admin/:app/:rm' => { prefix => 'My::Project::Admin' },
>   ],
>   args_to_new => {
>     foo => 'bar',
>     baz => 'bam',
>   }
> );

> First off, all args are now lowercase (the reason CAD is currently STUDDLY 
> CAPS
> is because it was first written to run under mod_perl and I thought caps 
> looked
> better in the config file... oh well). Upper case args will still be valid, 
> but
> preference will be given to the lc'ed version first.

This looks great!  I like the lower case params.

> I'm also thinking about adding the rule that
>   module-name
> would become
>   ModuleName

I like this a lot, too.

> For the mod_perl side, TABLE is currently done as simple name-value pairs in 
> the
>  httpd.conf. I'm not sure if this should still be done the same way for this
> version since you can't disambiguate between arrays or hashes coming from the
> httpd.conf. It's all arrays. So I'm thinking about adding a mod_perl directive
> to specify a class to use instead. This class would simply need to have an
> accessible @TABLE variable. So something like:
>
>   # in httpd.conf
>   CGIAPP_DISPATCH_TABLE_CLASS MyProject::Dispatch
>
>   # in MyProject/Dispatch.pm
>   package MyProject::Dispatch;
>   our @TABLE = (...);

Would it be a bad thing to force mod_perl users to use a subclass of
CA::Dispatch?  Something like this:

   # in httpd.conf
   PerlHandler MyProject::Dispatch

   # in MyProject/Dispatch.pm

   package MyProject::Dispatch;
   use base 'CGI::Application::Dispatch';

   sub dispatch_table {  ...  };


Just a thought...


Michael


---
Michael Graham <[EMAIL PROTECTED]>


---------------------------------------------------------------------
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]

Reply via email to