You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2007/10/30 10:53:15 UTC

Re: [api] Why do SlingHttpServlet*Wrappers wrap Sling objects, not javax.Servlet ones?

Hi,

Am Montag, den 29.10.2007, 11:19 +0200 schrieb Bertrand Delacretaz:
> public SlingHttpServletRequestWrapper(SlingHttpServletRequest delegatee)
> I would have expected
> 
> public SlingHttpServletRequestWrapper(ServletRequest delegatee)

This is just inline with the Servlet API HttpServletRequestWrapper,
which takes a HttpServletRequest. In addition, I would want the user of
the wrapper to know what (s)he does explicitly by declaring the
constructor according to its expectations and not having to ressort to
some JavaDoc codifying something which may be codified (better) by the
signature.

> ... the delegatee (why not call that simply "wrappedRequest" by the way?) ...

Well, I always use the name delegatee when implementing wrappers. But
wrappedRequest is equally fine and the HttpServletRequestWrapper simply
calls the parameter "request". I have no strong bias, probably
wrappedRequest is better than delegatee.

Regards
Felix