Ben:

I'm doing something very similar, and I've gone with the first method you
describe, of making a single base servlet class (in my case, DBServlet, as
virtually of my servlets talk to a database). I've over the last few weeks
doing some performance analyses and it seems to work pretty well in my test
so far, up to where the hardware starts to be the bottleneck at least. I
also use a part of your second suggestion: for all servlets that implement a
basic "table maintenance" kind of form (which are quite a few in a large
application!) I use a single servlet class (DBMaintServlet) and pass it the
name of the database object it's supposed to maintain. This means our
overall count of servlets is quite low comparatively, but we still get
customizable database maintenance for every database object (table or group
of tables). On top of this we take everything that is expected to take more
than a few seconds & queue it to an application server for handling at the
server end & notify the user later (either his next servlet request or in
e-mail).

Don't know if that helps, but FWIW!

Regards

Mike N.

JavaCorporate Ltd
http://www.javacorporate.com

-----Original Message-----
From: Ben Engber [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 10, 1999 11:29 AM
To: [EMAIL PROTECTED]
Subject: Servlet architecture question


Hello everyone,

I've been working on a framework for a large application here and am
looking for some advice on how I should implement it.

Currently, we've written a base servlet class that all other servlets
extend from.  The base servlet class performs error trapping,
authentication, etc., and passes the state of the current request to
protected methods via our own context class.

But it seems that a cleaner approach might be to have only one servlet
which loads and instantiates non-servlet classes based on the PATH_INFO of
incoming request.  That would eliminate the need to pass context objects
around, and might allow for better security.

On the other hand, inheriting from a base servlet might perform better (in
both cases a new object is instantiated per request, but perhaps the
servlet engine does some optimizations in this case)?

Does anyone have any suggestions as to which approach is better?  We're
expecting very high traffic (one million page views/day or higher).

Thanks,
Ben


--
Ben Engber
Software Engineer
The New York Times
[EMAIL PROTECTED]

___________________________________________________________________________
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

___________________________________________________________________________
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

Reply via email to