Hi,
Wish I had more time to participate in this one, but here's my quick 2
cents, just so I can get a double vote later on the colour of the
shed. (Chapeau, Boshi, Beanie, Yarmulka, Helmet ...)
I think this is basically the old REST thread revived, with the "cool
URLs" idea looking to me like REST thang with a milder flavor of
koolaid. Though I haven't had time to read through it thoroughly.
On Date: Thu, 08 Dec 2005 03:13:59 -0500, Michael Graham <[EMAIL PROTECTED]>
wrote:
>
> I have a feeling this is going to be a tricky module to write, because
> when an URL matches multiple targets, the system has to choose the best
> match. Static strings should be preferred against variable matches, and
> maybe longer matches are considered more precise? (That's how
> Config::Context does it anyway.)
>
I suggest using whichever match comes first in the dispatch list. That
way it's easy to understand and control, no?
Dave
> For instance, with the URL /admin/users/edit, given the following
> dispatch table, the fourth mapping should probably win because it
> matches the longest static substring.
>
> 1. :app/:rm/:id => { }
> 2. admin/:app/:extra => { }
> 3. admin/:rm/:id => { app => AdminSystem }
> 4. admin/users/:rm => { app => UserAdmin }
>
> (And at the same time, the system has to be smart enough to complain
> that mappings 2 and 3 are equivalent.)
>
> And then the same problem exists in reverse, when you try to implement
> to_uri(). Given the following call:
>
> $self->to_uri('app' => 'UserAdmin', rm => "edit", id => 23 );
>
> and based on the above mapping table, you could end up with two URLs:
>
> A. /UserAdmin/edit/23 (from map #1)
> B. /admin/users/edit?id=23 (from map #4)
>
> Which is the "correct" URL? URL B uses the most precise match (longer
> static string), but URL A uses fewer query parameters and makes a
> shorter, neater URL.
>
> Of course, maybe the Rails people have already solved the algorithms to
> do these things?
>
>
> 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]
---------------------------------------------------------------------
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]