"Suggs, S. Brian" wrote:
> Thank you Craig for the concise speedy response. I would like to rephrase
> my second question so that you or anyone else will have a better
> understanding of what I am looking for.
>
> 1.) what would be the performance difference for sending all request
> through a single servlet and having that servlet forward all of the request
> to Java beans (using Java reflection) to handle the business logic versus
> having a specialized servlet for each business logic unit?
>
> i.e.
> CASE 1:
> having a simplesingle servlet that would handle the requests
> for both a news page and a stock page
> CASE 2: vs.
> having two servlets to handle each request. Such as having
> a newsServlet and a stockServlet.
>
Any performance differences between one versus two servlets in this case are
going to be so vanishingly small that they have no practical impact. What you
really ought to be more concerned about, IMHO, is the maintainability and
flexibility of your overall design.
Along that line, a model-view-controller oriented design architecture (typically
called "model 2" in JSP circles, because that is what it was originally called
in the JSP 0.92 spec) has become quite popular. The idea is that a web
application has a single controller component (typically a servlet) that
dispatches requests to an appropriate action class (thus updating the model),
which then forwards control to an appropriate JSP page or servlet to display the
response to the user (i.e. the view). Using an architecture like this gives you
the advantages of separating your business logic and presentation logic so that
you can (in many cases) modify one without affecting the other.
One open source architecture that implements this approach is called Struts
(http://jakarta.apache.org/struts). NOTE, I'm the primary developer for this
package; it's an implementation of the MVC paradigm that grew out of
architecture discussions on JSP-INTEREST over the last couple of years.
There was also a JavaWorld article on the "Model 2" approach a few months ago
(check their archives), and the same basic design pattern is described in the
J2EE Blueprints book that Sun published (http://java.sun.com/j2ee).
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html