This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies.
When you have the page flow logic and screen navigation implemented in views (Web pages), you must change the source code (code-behind) of the views to change the page flow.
- 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.
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.
Logical view of the Application Controller pattern
- There are more solution elements to manage.
- You need a way to create and connect views and controllers.
- For a simple implementation of this pattern, see the ContactsController class in the Model-View-Presenter QuickStart.
- For a simple implementation of this pattern in the context of a business module, see the CustomersController class in the Modularity QuickStart.
For more information about how to consume an application controller from presenter classes, see How to: Use a Module Controller from a Presenter.