Front controller pattern
From CSSEMediaWiki
Revision as of 02:29, 19 October 2010 by Martin Doms (Talk | contribs)
In a Front Controller system a single class handles all incoming requests. The handler processes requests and delegates to a command hierarchy to carry out the action. The runtime behaviour of this class can be enhanced with decorators.
Which command is instantiated and executed can be determined either statically (using conditional logic) or dynamically (using dynamic instantiation). Static instantiation has the benefit of compile-time error checking and flexibility in URL structure, while dynamic resolution allows the creation of new command types without changing the underlying handler class.