Page 2 of 2

Posted: Fri Aug 25, 2006 12:33 pm
by Christopher
Actually your index.php appears to be a Front Controller and index2.php appears to be a Page Controller. I guess my point was that the same code is run in your example no matter how they are called, so it is not clear specifically how they differ.

Posted: Fri Aug 25, 2006 1:26 pm
by alex.barylski
As I understand it, you are correct in that index.php is implemented as a single entry application, acts primarily as a front controller and delegates actions to appropriate view/controllers

Whereas index2.php does not need a front controller as events are routed automatically by clicking on links...

Knowing this, do you have any opinions on either design that you would like to share?\

Obviously there are some differences which have implications...

I've stumbled across a few, but other than the obvious, can you think of anything of interest which I might want to consider???

If not that's cool...just listening to me babble is letting me basically note take on my own ideas and helps powering my think cycle :P

Posted: Fri Aug 25, 2006 2:11 pm
by Christopher
For me it is usually about reducing dependencies to those that are necessary. With a Page Controller you can achieve the same thing as with a Front Controller (knuckleheads like Tony Marston regularly rant). But with a page controller the Action has dependencies on the common code. With a Front Controller the Actions know very little to nothing about the common code. This is a negative for the Front Controller for many programmers because it makes some changes more difficult. But I find that it forces me to be more thoughtful when adding functionality to the global/service code which I have proved to myself reduces errors and cruft. A system with fewer dependencies needs fewer test.