commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [collections] Collections Next Gen
Date Thu, 03 Apr 2003 04:19:01 GMT


On Wed, 2 Apr 2003, Rodney Waldhoff wrote:

> On Wed, 2 Apr 2003, Henri Yandell wrote:
>
> >
> > That's fine.
> >
> > So ProxyMap is special, all ProxyMap implementations should be
> > package-private and available through a MapUtils class and can have
> > constructors which take a collection as copy-by-reference as it's not a
> > public API?
>
> -1 to making ProxyMap package scope, and only accesible via MapUtils.

All implementations of ProxyMap. ProxyMap itself wouldn't be.

I've been assuming that an extension of ProxyMap would use the same
copyReference constructor style as ProxyMap via a super call. ProxyXxx's
are abstract, so the contract isn't such a big deal for them.

> I think you're reading a little too much into this "contract".  The

Probably. Most of the classes in Collections seem to be implemented a
certain way and I'm trying to grok that way so I can refactor the classes
which do not fit yet.

Hen

> java.util.Map javadocs *recommend* that all *general purpose* Maps have a
> no-arg, empty-Map constructor and a Map copy-constructor.  There are
> obviously places where this recommendation is going to be violated
> (consider a Map implementing a fixed mappping).  Since we're
> obviously specifying a specific class when invoking a constructor, I see
> little problem with having implementation-specific behavior here.
>
> Besides, we can't adequately implement ProxyMap(map) as a copy
> constructor anyway (what's the proxied map type?).



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


Mime
View raw message