Michael,
First, thanks for picking up the torch of implementation on this.
On 2005-12-14, Michael Peters <[EMAIL PROTECTED]> wrote:
> 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.
I really prefer the lower case names.
>:app - will be converted into the module name using the same current rules. So
> module_name
> will become
> Module::Name
> I'm also thinking about adding the rule that
> module-name
> would become
> ModuleName
As long as no one has underscores in their module names, we're safe.
That could be worked around if it comes up.
> I'm pretty sure at this point I can keep all of the old stuff functioning the
> same if the old interface is used. But I would encourage users to use the new
> API to accomplish the same goals.
That works for me. I haven't yet started using the module.
One detail you didn't cover in your write was named params:
':app/:rm/:id'
I think that's Rails default dispatching, and is a pattern I like.
Adding named params for me is the most significant functionality
difference over what's there now.
I could help wit the code for it, if you'd like.
One detail to keep in mind for implementation is that functions like
'uri_for' and 'link_to' will be accessing the same internal data
structure. I suppose all that means for now is that '@TABLE' be
accessible somewhere as part of the CGI::App object.
When we get to implementing 'uri_for', we may possibly want to create an
alternate representation of it that is easier to do reverse lookups on.
Mark
--
http://mark.stosberg.com/
---------------------------------------------------------------------
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]