On Tue, 12 Oct 1999, Martin Kuba wrote:
> Andy Bailey wrote:
> > I would seriously question the idea that you never need more than
> > one servlet per application. You should plan on having one servlet
> > for each task that is part of the application and if you abstract
> > things properly you can reduce this number usually.
> >
> > It is also a bad idea to override the servlet service method as
> > that is usually implemented by the ServletEngine vendor to route
> > requests to the right place.
> >
> > If you try and have one servlet that does all you are placing all
> > your eggs in one basket. You will end up with a large, hard to
> > maintain and badly implemented servlet that will never end up
> > doing things as you it to in the first place.
>
> If you use more then one servlet per application, you need a one
> special servlet for initializing common resources like database
> connections or HTML templates, otherwise servlets cannot share
> resources.
[ ... ]
I don't think this is right either. These common resources should not
be implemented as servlets (or in servlets), but rather as helper
classes that the servlets can share (where they fall in terms of a
three-tier architecture is then a little unclear, but that doesn't
really matter). You can use ServletContext's to share them, I believe.
I think all this will be made easier by some of things being added in
the 2.2 spec, where they're adding a lot of stuff that will aid in
building distinct multiple applications within a server/servlet engine.
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[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