OK, this is working great. I'm posting mostly out of interest since nobody understood me the first time I explained how I wanted to carry this idea from a PHP framework point of view
Everything to do with URLs and link production (not yet developed) is centered around a "Router" class and an XML file which provides everything it knows about what a URL looks like.
I wont post the code for the Router class yet, but just to explain:
My front controller delegates requests over to action controllers. Each "action" belongs to a "module" which is effectively a collection of actions in the same sub-package.
e.g. app.somemodule.SomeAction, app.somemodule.AnotherAction, app.anothermodule.IndexAction etc.
The only way the Front controller knows which action to run is from the URL. Ok, nothing new here, this would work fine.
http://somesite.com/context-path/forum/createPost.do?threadId=52 But with mine you'd skip web.xml entirely and modify a file I provide called routing.xml:
Which allows
http://somesite.com/context-path/forum/createPost/threadId/52 Then there's the case where you decide that by default each module will at least have some default action. Let's call it the IndexAction - "index".
http://somesite.com/context-path/forum/index.do http://somesite.com/context-path/forum.do Or in my routing.xml we can just explicitly provide a parameter if it's not there.
http://somesite.com/context-path/forum/index http://somesite.com/context-path/forum Then one day you decide to change your URL schema to something like:
http://somesite.com/context-path/moduleName-actionName Easy:
Now one day we decide to change the "forum" module to "bbs" but only in terms of the URL, no point in rewriting a whole load of code to change all the hyperlinks right?
Now going to
http://somesite.com/context-path/bbs/createPost/threadId/52 actually takes you to the forum module's createPost action tranparently.
Maybe in our first example we decide to clean up a bit and drop the "threadId" bit from our URL, just passing the ID instead:
Now the URL
http://somesite.com/context-path/bss/createPost/52 is actually the same as the first URL I posted in this post.
I can't be bothered to go on any more, but basically that's what I've been doing and what I was talking about a few weeks ago when I first mentioned this and got a slightly confused response