Hi,
The current architecture of my application is:
JSP View1 ----> Servlet1 -----> JSP View2
JSP View2 ----> Servlet2 -----> JSP View3
JSP View7 ----> Servlet5 -----> JSP View4
...
...
In other words, all the views that have Forms have their own controllers (servlets). The task of all the Servlets is to do validation and decide on the next view to display.
* Is this a good approach?
* Or should I use the Front Controller pattern, have a single Servlet as the Controller and turn each of the existing Servlet Controllers to regular Java class controllers?
Any input is highly appreciated.
-
Design Pattern Question (5 messages)
- Posted by: Ranga S
- Posted on: June 25 2002 16:31 EDT
Threaded Messages (5)
- Design Pattern Question by P G on June 25 2002 17:12 EDT
- Design Pattern Question by Race Condition on June 26 2002 13:35 EDT
- Design Pattern Question by greg farris on June 27 2002 12:22 EDT
- Design Pattern Question by Colin Cassidy on June 28 2002 08:16 EDT
- Design Pattern Question by Ranga S on June 28 2002 14:14 EDT
-
Design Pattern Question[ Go to top ]
- Posted by: P G
- Posted on: June 25 2002 17:12 EDT
- in response to Ranga S
I personally feel that using the FrontController Architecture is more easy to maintain. -PG -
Design Pattern Question[ Go to top ]
- Posted by: Race Condition
- Posted on: June 26 2002 13:35 EDT
- in response to Ranga S
PG is right on. -
Design Pattern Question[ Go to top ]
- Posted by: greg farris
- Posted on: June 27 2002 12:22 EDT
- in response to Race Condition
Yep one controller seems to easier to maintain, single point entry makes security, exception handling, logging, easier. -
Design Pattern Question[ Go to top ]
- Posted by: Colin Cassidy
- Posted on: June 28 2002 08:16 EDT
- in response to Ranga S
As other people have pointerd out, front controller is the standard way of approaching this problem. With current technology it is the simplest approach w.r.t. security, flow control etc.
The thing I don't like so much about the front controller, however, is that it makes decoupling parts of an application difficult. Ideally, I would like to be able to 'componentise' an application - not just the business logic, but the user interface too. I could then package and deploy parts (features) of the application separately just by changing a few configuration/deployment descriptors.
Unfortunately, I have found this difficult to achieve in practice because splitting parts of a web application into different wars means that they can't share the same context - creating problems with authentication and state control etc.
Any thouths on this appreciated!
Colin. -
Design Pattern Question[ Go to top ]
- Posted by: Ranga S
- Posted on: June 28 2002 14:14 EDT
- in response to Colin Cassidy
I sure appreciate your answers.
* I've decided to make a slight modification to the architecture.
* I've introduced a "Main Controller Servlet" that acts as the single point of contact. It reads a config file and forwards the request to the appropriate Controller servlet.
* This is the architecture I have now.
JSP View1 ---> Main Controller ---> Servlet1 ---> Some JSP ViewA
JSP View2 ---> Main Controller ---> Servlet2 ---> Some JSP ViewB
JSP View3 ---> Main Controller ---> Servlet1 ---> Some JSP ViewC
Appreciate your comments/thoughts on this. Thanks.