Application Controller

Problem

When you have the page flow logic and screen navigation implemented in views (Web pages), you must change the source code of the views to change the page flow.

Forces

  • You want to centralize the flow of the application and screen navigation, so that you can change flow or logic in a single location, with no changes (or minimal changes) to the source code of views.
  • You want to minimize the effort required to update the page flow logic.
  • You want to minimize page flow logic code duplication in views.

Solution

Create a separate object, the application controller, to control and centralize the page flow and screen navigation logic. Write your view code to interact with the application controller to execute page flow and screen navigation logic.
To enable flow between pages, the application controller manages and maintains state across user interactions. It can also interact with the model to perform business actions and define the flow of the application based on the state of the model.
Figure 1 illustrates the logical view of the Application Controller pattern.
LogicalView_ApplicationControllerPattern.png
Figure 1
Logical view of the Application Controller pattern.

Liabilities

  • There are more solution elements to manage.
  • You need a way to create and connect views and controllers.

Last edited Nov 20, 2007 at 11:32 AM by ejadib, version 2

Comments

No comments yet.