Dear Konstantin,

I am indeed talking about org.apache.catalina.connector.Request.
HttpServletRequest is an interface that we expose to Servlets. However
there is no interface that exposes everything necessary for Tomcat to work.
Therefor Tomcat is using the Request class as the type of the
parameter/variable/attribute. At some points attributes are even accessed
directly, not through methods. This makes it kind of tricky when
experimenting with different behavior for Requests. Therefor I was curious
if there was a reason for not using an interface but directly using the
class.

Kind regards,

Roel Storms

2016-01-31 16:28 GMT+01:00 Konstantin Kolinko <knst.koli...@gmail.com>:

> 2016-01-31 13:30 GMT+03:00 Roel Storms <roel.sto...@gmail.com>:
> > Dear Tomcat Devs,
> >
> > I was wondering why Request is used all over Tomcat as a class and why we
> > didn't abstract a Request interface and implemented a StandardRequest as
> is
> > done by a lot of other components like Session->StandardSession;
> > Manager->StandardManager; Context->StandardContext; ...
> >
> > Is there any reasoning behind this?
>
> https://en.wikipedia.org/wiki/KISS_principle
>
> Also, there is already an interface
> [[[
> package org.apache.catalina.connector;
> public class Request implements HttpServletRequest
> ]]]
>
> and
> [[[
> package javax.servlet.http;
> public interface HttpServletRequest extends ServletRequest {
> ]]]
>
>
> If we are talking about other class
> [[[
> package org.apache.coyote;
> public final class Request {
> ]]]
>
> It is final and no other implementations are allowed.
>
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>

Reply via email to