hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: svn commit: r554367 - in /jakarta/httpcomponents/httpcore/trunk: ./ module-main/src/main/java/org/apache/http/protocol/ module-main/src/test/java/org/apache/http/protocol/
Date Tue, 10 Jul 2007 00:38:09 GMT
On 09/07/07, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Mon, 2007-07-09 at 13:56 +0200, Roland Weber wrote:
> > Hi Sebastian,
> >
> > > But in theory, one still has to use something like Integer.MAX_VALUE
> > > to absolutely guarantee that the entry will be added at the end...
> >
> > True. Now I remember why I wanted -1 to map to the end of the list.
> >
> > > If you don't want to use a magic number, why not have an addAtEnd() method?
> >
> > Because we already have too many methods in the interface to
> > manage two simple lists. *sigh*
> >
> > Add constants AT_END to the interfaces?
> > Or the extra methods? Or leave it as it is?
> >
>
> Roland,
>
> _Personally_ I do not simply see a legitimate use case for wanting to
> add a protocol interceptor at position three, five or three hundred and
> one. I just do not. One may legitimately want to have an interceptor
> executed first _before_ all other or last _after_ all others. That is
> it. To me #addXXXInterceptor(HttpXXXInterceptor itcp, int index) is
> pointless for all but two cases (0 or Integer.MAX_VALUE).
>
> Leave it as it is. It is good enough.
>

I'm inclined to agree with Oleg's use cases.

Though if you did want to get fancy with ordering, then I'd suggest
doing something like XStream which uses priorities.

For the simpler before/after case, perhaps use a two-valued indicator,
such as a boolean?

I think it is a bad idea to have to write calling code using 0 and
Integer.MAX_VALUE as actual values. There should be named constants.

S.

> Cheers,
>
> Oleg
>
>
>
> > cheers,
> >   Roland
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Mime
View raw message