Thursday November 01, 2007
Draft Specification for automatically mapping URLs to Controllers and Views Ted Husted has been working on a draft specification for "Heuristic Request/Response Mappings", based on technologies used by Rails, Struts 2 and Stripes.
The central idea is that instead of creating explicit mappings, the
framework applies a series of heuristic transformations to match a URI
with a code component and a view component.
The first part of the draft is available here:
* http://code.google.com/p/web-alignment-group/wiki/WAG_RFC_001
Before doing any more work on the description, I'd be very interested
on feedback as to whether I'm making any sense, or whether the draft
has turned into opaque gibberish :)
If you're developing a web framework (in any language) and use conventions to auto-map URLs-to-controllers and controllers-to-views, it'd be great to hear your feedback on this draft. It'd be pretty cool if you could switch frameworks/languages and use the same conventions across the board.
Posted in Java
at Nov 01 2007, 03:03:49 PM MDT
7 Comments
Search This Site
Recent Entries
- Wine Tasting in Napa Valley
- How to build a Shot-Ski
- Bus Project Update
- Farewell to the 2011-2012 Ski Season
- Cruising around the Western Caribbean
- Spring Break!
- A Spectacular Trip to Stockholm and Madrid
- Comparing Web Frameworks and HTML5 with Play Scala at Jfokus 2012
- Play Framework 2.0 with Peter Hilton at Jfokus
- Secure JSON Services with Play Scala and SecureSocial
Posted by Renaud Bruyeron on November 02, 2007 at 01:18 AM MDT #
Posted by Guillaume Laforge on November 02, 2007 at 01:47 AM MDT #
Posted by Graeme Rocher on November 02, 2007 at 03:11 AM MDT #
I do a similar thing with my (personal) framework (feather.fourspaces.com - note: not quite ready for prime time), but automapping always scares me a bit. There is always one more constraint to add, another type of mapping that would be nice, or even another url scheme that should map to the same handler (method).
So, while I have default mappings of /controllerSimpleClassName/methodName, for me this actually ends up creating a set of Regular Expressions under the hood. Then for more fine grained mapping, you can apply annotations like @HttpPost, @Path("^/contact/(\d+)/view/$"), etc...
Ultimately, my feel for it is that the simple auto-mappings are great, until you need a little more flexibility... then it doesn't matter what the heuristic is, you'll still need to use whatever tools the framework gives you, be that annotations, xml config file, whatever. And at that point, you loose all of the cross-framework goodness, and you're back where you started.
Also regarding the RFC:
Posted by Marcus Breese on November 02, 2007 at 02:36 PM MDT #
-Ted.
Posted by Ted Husted on November 03, 2007 at 02:24 AM MDT #
Posted by Thiago HP on November 05, 2007 at 06:00 AM MST #
Posted by Mark Hughes on November 09, 2007 at 05:54 PM MST #