Hi all,
I am just a bit confused with the following class structure.
Why does
javax.servlet.GenericServlet implement javax.servlet.ServletConfig? It IS a
servlet, not a servlet configuration. Seems like competely different responsibilities being assigned to one class.
Eg, it makes sense to have Employee class implement Person and Administrator interfaces (employee is a person, and has a role of administrator). But it does not make sense for the Employee class to implement EmployeeAddress interface.
In addition, GenericServlet inherits a
Servlet#getServletConfig() method, which complicates the picture even more.
Would not the following piece of code get servlet config:
Why would one ever use
GenericServlet#getServletConfig()? Does not it just return a reference to itself?
I'd say that the most appropriate relationship between servlet and servlet configuration should be *HAS*; servlet HAS a servlet configuration, then
GenericServlet#getServletConfig() would make sense.
I'd greatly appreciate your thoughts on this matter.
[ October 24, 2004: Message edited by: Alex Sharkoff ]