• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Why does GenericServlet implements ServletConfig

 
Ranch Hand
Posts: 89
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 89
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This must be a decorator design pattern. No doubt.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 89
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 89
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic