Building task flows
A web application consists of a number of pages that must be displayed to the user in a specific sequence. This sequence is not fixed—the user might make a decision as to which page they want to see next, or the application might decide to show a specific page with a warning or a request for more information.
If we did not have a controller layer, each page would have to contain both the actual components on the page as well as the logic to decide where to go next. This intermingling of functionality quickly becomes hard to maintain and is not considered a good programming practice.
That is why we have a controller layer to control the flow through the application. The controller layer manages the logic of what happens in which order so that the individual pages or code elements do not have to worry about this part of the application.
Bounded and unbounded task flows
Every application has one unbounded task flow—we saw that in the simple demo application in Chapter 1, My...