commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rall <>
Subject Re: [lang][collections] Utils having a public constructor
Date Tue, 13 Aug 2002 00:03:09 GMT
Daniel Rall <> writes:

> "Jack, Paul" <> writes:
> > There are valid reasons for keeping things as private as possible.
> > There are many cases in [collections] where bugs were found, or 
> > where algorithms could be more efficient, but we couldn't change
> > the existing code because it exposed protected fields that we wanted
> > to delete, or because it used a protected method whose signature
> > we couldn't change because it would break backwards compatibility.
> I agree that information/implementation hiding is a good thing.  I'm
> missing how this applies to addition of a constructor to classes
> consisting of static methods.

Further thought shows one edge case where this could be an issue,
where you want to dis-allow sub-classing to prevent access to
protected static fields via an instance of the sub-class.  Ain't life
a trade-off.

Daniel Rall <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message