Front Controller
Definition
Using a single component to process application requests.
Where to use & benefits
- JSP or Servlet.
- Design request handling component.
- Channel all requests through a single controller.
- Centralize request processing and view selection.
- Reduce business logic in a view
- Improve manageability of security
- Promote code reuse across requests
- Avoid code duplication
- Related patterns include
- Command combined with multiple requests.
- Intercepting Filter both centralize control of certain types of request processing.
- Page Controller -- an alternative way.
Example
Design a servlet to deal with all the requests.
Return to top