I would have to disagree. The decision to extend a servlet is highly dependent
upon your architecture and ultimately on the specific requirements of the system.
I have designed systems with a single servlet as well as others with a few
generalized servlets that include several specialized descendant servlets. And
each of these systems use variations on the MVC architectural theme.

I would agree, that as a general rule, a designer should keep a servlet as simple
as possible. But that mentality can be extended to just about any Java class. It
is always desirable to design classes so that there interfaces with other classes
are well defined, unambiguous, and easily maintained. The only thing that would
make a servlet's design depart from this spirit of objectivity is the lack of due
diligence on the designer's part.

-ernie


Danny Rubis wrote:

> Hey!
>
> I don't use Oracle but yes.
>
> The question is why would you want to do this?  If you use the
> Model View Control, you won't have much code in the servlet
> anyway to make it worth while to extend the class.  In my experiences,
> I have not found it to be an advantage.  Servlets are not very
> object-oriented anyway.
>
> Sans adieu,
> Danny Rubis
>
> kiran vattem wrote:
>
> > Hello Gurus,
> > sorry about the previous email, I sent it inadvertently...
> >
> > I have a question on servlet subclassing
> >
> > If I have Servlet1 that extends HttpServlet
> > Can I have a Servlet2 that extends Servlet1
> >
> > for example
> >
> > public class servlet2 extends Servlet1 {
> >
> > ....
> >
> > ...
> > }
> >
> > Is it a correct way of re using code?
> > I tried using this in Oracle's Jdeveloper,it would not work
> > Got compilation errors..
> >
> > Thanks
> > kiran
> > ______________________________________________________
> > Get Your Private, Free Email at http://www.hotmail.com
> >
> > ___________________________________________________________________________
> > 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
begin:vcard
n:Varitimos;Ernie
tel;cell:781-929-3856
tel;home:781-784-1997
tel;work:781-784-3900
x-mozilla-html:TRUE
url:http://www.skyserver.com
org:Skyserver Consulting, Inc.
adr:;;144 Upland Rd;Sharon;MA;02067;
version:2.1
email;internet:[EMAIL PROTECTED]
title:President
fn:Ernie Varitimos
end:vcard

Reply via email to