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.
- 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.
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.