Front controller pattern

From CSSEMediaWiki
Jump to: navigation, search
Sequence diagram of the Front Controller pattern.
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.


Personal tools