Posted: Fri Aug 03, 2007 5:56 pm
Ok ... you are clear so far.matthijs wrote:However, my main question now is how the actual processing by the controllers goes. A single controller/actions pair is clear. The Frontcontroller looks for a controller class in a specific directory, runs the given action or the default one.
This is where I get confused. The idea with a Front Controller is that you build many atomic Action Controller that are focused on specific tasks. If you need additional functionality you either add more actions (action methods) or you add additional controllers and link redirect or forward to them. If you need specific hierarchical controller behavior then implement an base action controller class that looks at additional parameters and dispatched additional controllers.matthijs wrote:But with a deeper nested set you end up with controllers with massive deeply nested if/then/else loops. Which are basically a copy of the mapper scheme. This controller management. Is it something you solve up front (in the front controller or mapper) or for each controller separately? I hope I'm clear what I mean.
On the View front, you can just attach strings or Template objects or View objects together to build any tree you want.
However usually straight "/controller/action/" is more than enough for most sites. Going back to one of your examples, "/users/germany/new/edit/" should probably be "/users/edit/new/country/germany/" where your route is "/controller/action/id/param1/value1/".