You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Gary Gregory <ga...@gmail.com> on 2018/11/21 17:49:19 UTC

Two HandlerEntry classes?

Hi All:

Do we really need two HandlerEntry classes?

- org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
- org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>

They are currently the same. Since they are both package private, using a
single class would mean making one public. I suppose the question is: Do we
need to hide this implementation detail so much as to make it _not_ a
public class.

Thoughts?

Gary

Re: Two HandlerEntry classes?

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Nov 22, 2018 at 1:52 AM Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2018-11-21 at 15:26 -0700, Gary Gregory wrote:
> > On Wed, Nov 21, 2018 at 3:08 PM Oleg Kalnichevski <ol...@apache.org>
> > wrote:
> >
> > > On Wed, 2018-11-21 at 15:02 -0700, Gary Gregory wrote:
> > > > On Wed, Nov 21, 2018 at 3:01 PM Oleg Kalnichevski <
> > > > olegk@apache.org>
> > > > wrote:
> > > >
> > > > > On Wed, 2018-11-21 at 10:49 -0700, Gary Gregory wrote:
> > > > > > Hi All:
> > > > > >
> > > > > > Do we really need two HandlerEntry classes?
> > > > > >
> > > > > > - org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
> > > > > > -
> > > > > > org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>
> > > > > >
> > > > > > They are currently the same. Since they are both package
> > > > > > private,
> > > > > > using a
> > > > > > single class would mean making one public. I suppose the
> > > > > > question
> > > > > > is:
> > > > > > Do we
> > > > > > need to hide this implementation detail so much as to make it
> > > > > > _not_ a
> > > > > > public class.
> > > > > >
> > > > > > Thoughts?
> > > > > >
> > > > > > Gary
> > > > >
> > > > > What would be the point of making this class or these classes
> > > > > public?
> > > > > Saving a few bytes of disc storage?
> > > > >
> > > >
> > > > I'm just curious that's all; having two classes that are exactly
> > > > the
> > > > same
> > > > but in two different packages looks a bit odd to me.
> > > >
> > >
> > > What is the downside of having two package private classes that
> > > happen
> > > to be the same?
> > >
> >
> > This email thread ;-) writing it, discussing it. Code duplication is,
> > generally speaking, not a great idea IMO.
> >
>
> Who decreed that? Who decided that public API pollution and coupling of
> unrelated classes is better than duplication of a few lines of code?
>

Hi Oleg,

I feel like you are being a bit disingenuous in asking for a reference on
this topic. Whichever way I might be misreading you, I'll attribute to the
email medium as a lousy tool for such discussions ;-)

I can see that having these duplicate classes is a compromise between code
duplication and visibility, so I will leave it at that for now.

Gary


> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: Two HandlerEntry classes?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2018-11-21 at 15:26 -0700, Gary Gregory wrote:
> On Wed, Nov 21, 2018 at 3:08 PM Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Wed, 2018-11-21 at 15:02 -0700, Gary Gregory wrote:
> > > On Wed, Nov 21, 2018 at 3:01 PM Oleg Kalnichevski <
> > > olegk@apache.org>
> > > wrote:
> > > 
> > > > On Wed, 2018-11-21 at 10:49 -0700, Gary Gregory wrote:
> > > > > Hi All:
> > > > > 
> > > > > Do we really need two HandlerEntry classes?
> > > > > 
> > > > > - org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
> > > > > -
> > > > > org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>
> > > > > 
> > > > > They are currently the same. Since they are both package
> > > > > private,
> > > > > using a
> > > > > single class would mean making one public. I suppose the
> > > > > question
> > > > > is:
> > > > > Do we
> > > > > need to hide this implementation detail so much as to make it
> > > > > _not_ a
> > > > > public class.
> > > > > 
> > > > > Thoughts?
> > > > > 
> > > > > Gary
> > > > 
> > > > What would be the point of making this class or these classes
> > > > public?
> > > > Saving a few bytes of disc storage?
> > > > 
> > > 
> > > I'm just curious that's all; having two classes that are exactly
> > > the
> > > same
> > > but in two different packages looks a bit odd to me.
> > > 
> > 
> > What is the downside of having two package private classes that
> > happen
> > to be the same?
> > 
> 
> This email thread ;-) writing it, discussing it. Code duplication is,
> generally speaking, not a great idea IMO.
> 

Who decreed that? Who decided that public API pollution and coupling of
unrelated classes is better than duplication of a few lines of code?

Oleg



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


Re: Two HandlerEntry classes?

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Nov 21, 2018 at 3:08 PM Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2018-11-21 at 15:02 -0700, Gary Gregory wrote:
> > On Wed, Nov 21, 2018 at 3:01 PM Oleg Kalnichevski <ol...@apache.org>
> > wrote:
> >
> > > On Wed, 2018-11-21 at 10:49 -0700, Gary Gregory wrote:
> > > > Hi All:
> > > >
> > > > Do we really need two HandlerEntry classes?
> > > >
> > > > - org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
> > > > - org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>
> > > >
> > > > They are currently the same. Since they are both package private,
> > > > using a
> > > > single class would mean making one public. I suppose the question
> > > > is:
> > > > Do we
> > > > need to hide this implementation detail so much as to make it
> > > > _not_ a
> > > > public class.
> > > >
> > > > Thoughts?
> > > >
> > > > Gary
> > >
> > > What would be the point of making this class or these classes
> > > public?
> > > Saving a few bytes of disc storage?
> > >
> >
> > I'm just curious that's all; having two classes that are exactly the
> > same
> > but in two different packages looks a bit odd to me.
> >
>
> What is the downside of having two package private classes that happen
> to be the same?
>

This email thread ;-) writing it, discussing it. Code duplication is,
generally speaking, not a great idea IMO.

Gary

>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: Two HandlerEntry classes?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2018-11-21 at 15:02 -0700, Gary Gregory wrote:
> On Wed, Nov 21, 2018 at 3:01 PM Oleg Kalnichevski <ol...@apache.org>
> wrote:
> 
> > On Wed, 2018-11-21 at 10:49 -0700, Gary Gregory wrote:
> > > Hi All:
> > > 
> > > Do we really need two HandlerEntry classes?
> > > 
> > > - org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
> > > - org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>
> > > 
> > > They are currently the same. Since they are both package private,
> > > using a
> > > single class would mean making one public. I suppose the question
> > > is:
> > > Do we
> > > need to hide this implementation detail so much as to make it
> > > _not_ a
> > > public class.
> > > 
> > > Thoughts?
> > > 
> > > Gary
> > 
> > What would be the point of making this class or these classes
> > public?
> > Saving a few bytes of disc storage?
> > 
> 
> I'm just curious that's all; having two classes that are exactly the
> same
> but in two different packages looks a bit odd to me.
> 

What is the downside of having two package private classes that happen
to be the same?

Oleg



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


Re: Two HandlerEntry classes?

Posted by Gary Gregory <ga...@gmail.com>.
On Wed, Nov 21, 2018 at 3:01 PM Oleg Kalnichevski <ol...@apache.org> wrote:

> On Wed, 2018-11-21 at 10:49 -0700, Gary Gregory wrote:
> > Hi All:
> >
> > Do we really need two HandlerEntry classes?
> >
> > - org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
> > - org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>
> >
> > They are currently the same. Since they are both package private,
> > using a
> > single class would mean making one public. I suppose the question is:
> > Do we
> > need to hide this implementation detail so much as to make it _not_ a
> > public class.
> >
> > Thoughts?
> >
> > Gary
>
> What would be the point of making this class or these classes public?
> Saving a few bytes of disc storage?
>

I'm just curious that's all; having two classes that are exactly the same
but in two different packages looks a bit odd to me.

Gary


>
> Oleg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Re: Two HandlerEntry classes?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Wed, 2018-11-21 at 10:49 -0700, Gary Gregory wrote:
> Hi All:
> 
> Do we really need two HandlerEntry classes?
> 
> - org.apache.hc.core5.http.impl.bootstrap.HandlerEntry<T>
> - org.apache.hc.core5.http2.impl.nio.bootstrap.HandlerEntry<T>
> 
> They are currently the same. Since they are both package private,
> using a
> single class would mean making one public. I suppose the question is:
> Do we
> need to hide this implementation detail so much as to make it _not_ a
> public class.
> 
> Thoughts?
> 
> Gary

What would be the point of making this class or these classes public?
Saving a few bytes of disc storage?

Oleg


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