- Motivation
- Used to implement controller part of MVC pattern for very complex UI navigation logic
- Summary
- Front Controller solves the decentralization problem present in Page Controller by channeling all requests through a single controller.
- The controller itself is usually implemented in two parts: a handler and a hierarchy of commands.
Front Controller structure | Front Controller, typical scenario | | |
- When to Use
- You have decided to use the Model-View-Controller(MVC) pattern for your dynamic Web application.
- You have reviewed the Page Controller pattern, but your page controller classes have complicated logic, are part of a deep inheritance hierarchy, or your application determines the navigation between pages dynamically based on configurable rules.
- Related Patterns
- Intercepting Filter. This pattern describes another way to implement recurring functionality inside a Web application. Filters tend to deal with lower-level functions such as decoding, authorization, authentication, and session management where as Front Controller and Page Controller deal with application-level functionality.
- Page Controller. This pattern is a simpler alternative to Front Controller. Page Controller has a single controller object per page as opposed to the single object for all requests. Page Controller is a more appropriate starting point for most applications. Only when the need arises should you turn to Front Controller.
- Specific Considerations
- Page Controller Vs Front Controller
- Page Controller is a more appropriate starting point for most applications. Only when the need arises should you turn to Front Controller.
- References
- MSDN :Front Controller Tutorials
- MSDN: Implementing Front Controller in ASP.NET Using HTTPHandler.
|
|