Front Controllers - Bad Design?
Posted: Thu Nov 06, 2003 8:42 pm
Harry Fuecks has some interesting comments about front controllers http://phppatterns.com/index.php/articl ... ew/81/1/1/
.
They are criticised on grounds of speed but I think it is possible to write a zippy controller. Command hierarchies & lengthy switch cases can be slow - so don't use them. Instead, a chain of includes and a script naming convention seems to work very well with no noticable, real-world speed penalty.
The other, possibly more serious, criticism is that applications using front controllers are hard to integrate with other programs. Can't think of an answer to that except to say it's probably never going to be easy, front controller or not.
I've started trying to put together a framework which employs a front controller so it would be good to hear of your experiences with them, and if you also think it's just a bad design decision in a scripting language like php.
.
They are criticised on grounds of speed but I think it is possible to write a zippy controller. Command hierarchies & lengthy switch cases can be slow - so don't use them. Instead, a chain of includes and a script naming convention seems to work very well with no noticable, real-world speed penalty.
The other, possibly more serious, criticism is that applications using front controllers are hard to integrate with other programs. Can't think of an answer to that except to say it's probably never going to be easy, front controller or not.
I've started trying to put together a framework which employs a front controller so it would be good to hear of your experiences with them, and if you also think it's just a bad design decision in a scripting language like php.