Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why does GenericServlet implements ServletConfig  RSS feed

 
Sergei Zhylinski
Ranch Hand
Posts: 87
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I found some topics, devoted to this issue (1, 2, 3).

And I would like to clarify the situation. The reason why I've created a forth topic about it is may I say that ServletConfig, GenericServlet and HttpServlet where formed on the basis of a Decorator design pattern? I've created a bried UML diagram of a Servlet API:



Servlet_API_class_diagram.png
[Thumbnail for Servlet_API_class_diagram.png]
 
Sergei Zhylinski
Ranch Hand
Posts: 87
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This must be a decorator design pattern. No doubt.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the paragraph "Easier initialization" in http://www.servlets.com/soapbox/servlet21.html for some explanation.
 
Sergei Zhylinski
Ranch Hand
Posts: 87
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:See the paragraph "Easier initialization" in http://www.servlets.com/soapbox/servlet21.html for some explanation.


Thanks. After having read the paragraph I begin to understand why GenericServlet possesses overloaded "init" method (in version 2.5 the version of this method, that takes no arguments, has become empty). But the primary question was does all of this correspond to a certain design pattern.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see the Decorator pattern in this. It's not like there are other interfaces that could alternately or additionally be added to GenericServlet, or that there are other classes to which ServletConfig could be added.
 
Sergei Zhylinski
Ranch Hand
Posts: 87
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:I don't see the Decorator pattern in this. It's not like there are other interfaces that could alternately or additionally be added to GenericServlet, or that there are other classes to which ServletConfig could be added.


Can you tell, what pattern is used, if any?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any pattern here. Do you? And regardless of whether you do, do you think it matters?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!