|
I'm looking at this code again. Does Route.expand really need to take a
Context? It seems like all it should ever really need is a Map. James - thoughts? - Dan Jim Ancona (JIRA) wrote: [ https://issues.apache.org/jira/browse/ABDERA-95?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564498#action_12564498 ]Jim Ancona commented on ABDERA-95: ---------------------------------- The problem with my fix is that the third parameter to RouteManager.urlFor() is an Object and my fix only handles the case where it is a Map. If you look at RouteManager.getContext(), you'll see that it handles two other cases (Contaxt and Object). I couldn't see a general way to add the extra parameters to the Context. (Contexts don't even have the equivalent of Map.getKeys(), so you can't find out what in them in order to merge them.) My code will work in the current case, but would fail if a caller passed something other than a Map to RouteManager.urlFor() . This look to me to be better than the servicesPattern approach. I had tried an approach using code that I wrote to parse a URI according to a URI template, but as James said, you can't do it in the general case, and besides the Principle of Least Power[1] applies: Routes are less powerful than templates but still solve the problem cleanly and therefore are more desirable in this case. [1] - http://www.w3.org/2001/tag/doc/leastPower.html -- Dan Diephouse MuleSource http://mulesource.com | http://netzooid.com/blog |
- [jira] Created: (ABDERA-95) DefaultProvider doesn't p... Jim Ancona (JIRA)
- [jira] Updated: (ABDERA-95) DefaultProvider does... Jim Ancona (JIRA)
- [jira] Updated: (ABDERA-95) DefaultProvider does... Jim Ancona (JIRA)
- [jira] Commented: (ABDERA-95) DefaultProvider do... Dan Diephouse (JIRA)
- [jira] Commented: (ABDERA-95) DefaultProvider do... Dan Diephouse (JIRA)
- [jira] Commented: (ABDERA-95) DefaultProvider do... Jim Ancona (JIRA)
- Route.expand (was Re: [jira] Commented: (ABD... Dan Diephouse
- Re: Route.expand (was Re: [jira] Comment... James M Snell
- Re: Route.expand (was Re: [jira] Com... Jim Ancona
- Re: Route.expand (was Re: [jira... James M Snell
- Re: Route.expand (was Re: [... Jim Ancona
- [jira] Updated: (ABDERA-95) DefaultProvider does... Jim Ancona (JIRA)
- [jira] Closed: (ABDERA-95) DefaultProvider doesn... Dan Diephouse (JIRA)
