1.2. Front Controller

Front Controller is a container to hold the common processing logic that occurs within the presentation tier and that may otherwise be erroneously placed in a View. A controller handles requests and manages content retrieval, security, view management, and navigation, delegating to a Dispatcher component to dispatch to a View. The Front Controller pattern creates central control logic for presentation request handling. The Front Controller is different from the Intercepting Filter in that the Front Controller is determining processing based on the request and an Intercepting Filter is modifying the request.

UML representation


Benefits

The following lists the benefits of using the Front Controller pattern:
  • Centralizes control logic
  • Improves reusability
  • Improves separation of concerns

When to Use

You should use the Front Controller pattern to:
  • Apply common logic to multiple requests
  • Separate processing logic from view
Comments