Programmer epiphany

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
Post Reply