A Lazy Sequence

Reversible and composable routes?

Reversible routes are a mechanism for a URL dispatcher to provide a mapping from some name or handle and a set of arguments back to a URL in a way that does not expose the particular route configuration to the rest of the application. Ideally this means that any name is unique for the route configuration to allow predictable reversal.

Composable routes allow small routing configurations to be combined together to form a larger routing configuration. For instance you may combine multiple application configs into a site wide configuration. At the extreme end of this scale, as seen in Compojure for instance, middleware and route configuration are indistinguishable, and routes can be defined parametrically. 

Is it possible to have a system that allows for both, or must you concede some amount of reversibility and  composabiltiy in any system with both? The two areas I see as being difficult to overcome are that: 

21 November 2012