|Front Controller Pattern
- The presentation-tier request handling mechanism
must control and co-ordinate
processing of each user across multiple requests..
- Such control mechanisms may be managed by a
- The system requires a centralized access
point for presentation-tier request
- Centralized control mechanism will handle
- Integration of system services
- Context Retrieval
- View Management
- View Navigation
- Problems that may occur without centralized
- Each view is required to provide its own
system services, often resulting in duplicate code.
- View navigation is left to views which
results in mixed (blended) view content and
- Distributed control is more difficult to
maintain as the changes will often need to
be made in numerous places.
- Common system services processing such as
authentication and authorization checks.
- Logic is handled in one central location
- Decision points exist for retrieval and
manipulation of data.
- Multiple views are used to respond to
similar business requests.
- Centralized point of contact for handling a
request – to control and log a user’s progress
through the site.
- System services and view management logic
are relatively sophisticated.
- A controller as the initial point of contact for
handling a request.
- The controller manages
- Handling of request
- Delegate business processing
- Manage choice of an appropriate view
- Handling errors
- Manage the selection of content creation strategies.
- Object requesting the generation of the view.
- Initial point of contact for handling all
requests in the system.
- Controller may delegate to a helper to complete
and authorization of a user to initiate contact retrieval.
- Responsible for view management and navigation,
managing the next view to present to the user
- Represents and displays information to the client.
- Retrieves information from a model
- Responsible for helping a view or controller
complete its processing.
- Also responsible for gathering data required by the
view and store it in the intermediate model.
- Servlet Front Strategy
- The Front Controller is implemented as a servlet.
- This is the preferred to the JSP Front Strategy.
- JSP Front Strategy
- The Front Controller is implemented as a JSP Page
- Base Front Strategy
- Implementing a controller base class whose
implementation other controllers may
- Centralizes control
- Improves manageability of security
- Improves reusability