Problem: You want to centralize and modularize action and view management.
In the presentation tier, there are typically two decisions to be made upon the arrival of each request:
1/First, the incoming request must be resolved to an action that services the request. This is called action management.
2/Second, the appropriate view is located and dispatched. This is called view management.
You can encapsulate action management and view management in different parts of the application. Embedding this behavior within a Front Controller centralizes the functionality, but as the application grows and the code becomes more complex, it's a good idea to move this behavior into a separate set of classes, improving the code's modularity, reusability, and extensibility." View management is handled by the "Application controller".Try to read this book, it's excellent and ... necessary for part II
Hope this help Jose
Joined: Jun 14, 2005
Jose, I have been reading this book but it does not explain my question. It only talks about the Front Controller delegating to the Application Controller and then the application controller forwarding to the View. But I think in my case the client calls the JSP i.e. when a certain request is sent. In my sequence diagram, I was representing it as the Client sending a request to the JSP. Now I think the client sends the request to the FrontController and it in turn sends it to a response JSP. So there would be no request JSPs!!! Is this correct?
Joined: Jun 22, 2005
The client sends the request to the FrontController (really, the url corresponding to a link or a button in a page, is mapped to a servlet-the FrontController- in the web application configuration file), this object intercepts all requests.Here you have two choices: 1/The FrontController, processes the request and forwards the response to a JSP, in this case, view management is handled by the Frontcontroller (it may use command pattern, a view Helper and a screen flow manager) 2/A FrontController, (you have a single entry point to your application)only intercepts requests and forwards them to an ApplicationController which extracts data, processes requests (using Command pattern) and handles view management. There are many benefits with the second alternative.