Consider a use case of the form:
- The system shows a list of potential filters (by name, by creation time...).
- User chooses a filter and supplies necessary parameters.
- System shows a list of potential objects.
- User chooses a single object.
- System returns the chosen object in some way.
I'm stuck on how this sequentiality would be enforced in the application.
Assume that we try to loosely couple the UI from the business logic. I would suspect that we have some kind of UI class (Command-line, graphical...). This would be one end of the boundary. On the other side of the boundary, there would be one or more controller classes.
On the one hand, I could enforce this sequentiality in the UI. By going step by step through this use case, it would be very easy to prevent the user from starting step 4 before completing step 2. In the controllers, there would be some method for every substep ( searchWithFilters(...), chooseInList(...)) and the UI would call them at the appropriate times. However, if the UI happen to be redesigned in something else, it is up to that designer to enforce the sequentiality in his UI.
Is there any way I can enforce this sequentiality in the controller, so that this burden is not upon the UI? Would this be a good idea to do? How would I do this?