This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes One servlet/use case or command pattern? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "One servlet/use case or command pattern?" Watch "One servlet/use case or command pattern?" New topic

One servlet/use case or command pattern?

Tonny Tssagovic
Ranch Hand

Joined: Dec 30, 2003
Posts: 226
Hello guys,
What are the impacts of having a Servlet for each Use case, and is thus simply delegating thin clients calls to the EJB and it is the client�s responsibility to choose which Servlet to call depending on required functionality and when is it more appropriate to have a controller Servlet with a conditional statement (or command pattern) deciding which EJB/Object function to call depending on parameters passed by the client? What are the consequences of choosing one of these solutions to another? Is there a performance benefit of choosing one instead of the other? (Having a big pool of big do-it-all servlets of many small pools of different servlets with different tasks).
PS: I know that the controller pattern decouples the client from the server, and thus is a good thingy, but I don�t think in this case (just few use cases) it matters anyway
- I have seen "prof" code using both strategies, and want to know Pros/Cons
It is sorta covered in the JavaRanch Style Guide.
subject: One servlet/use case or command pattern?
Similar Threads
DAO Pattern & Head First Series
Delegating requestes to different servlets based on the submission.
Design help!
Chapter 2 (HFSJ) notes , may be useful for anyone
I'm new to sevlets help