On Jan 15, 2008, at 8:14 AM, Chris AtLee wrote:

I just had a chance to look at the Routes 2 spec, and this was my
first thought as well.  Having route names as attributes on the
RouteMap object will be very confusing since the methods used to
manipulate the RouteMap will be indistinguishable from the routes
themselves.  RouteMap.add("foobar", ...) or RouteMap.connect("foobar",
...) is clearer.  You also risk name conflicts with RouteMap.foobar -
what happens if I want a route called "fail" or "redirect"?

Mmm, it's not such a big deal I guess to use connect. The main issue with the current syntax, as Mike points out, is that the argument's change positions with named routes right now, so maybe map.named('name', 'path'...) and all map.named connections require the Route name to be present. This would at least solve the moving argument issue with the current map.connect.

I think with respect to the default routes and route minimization,
explicit is better than implicit.  If users want
"/{controller}/{action}/{id}" with defaults and minimization, there
should be three routes defined, for "/{controller}",
"/{controller}/{action}" and "/{controller}/{action}/{id}".  When a
user creates a new project via paste, these routes can be setup for
him.

Definitely, this is why Route minimization is gone entirely from generation. Your route you name is the only possible route that will be used for generation when you generate using the name. This is much more predictable.

I also suggested to Mike having the user make all the minimized Routes.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to