commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections] Size and scope issues
Date Mon, 19 Apr 2004 21:50:39 GMT
From: "Noel J. Bergman" <noel@devtech.com>
> > > - ALL the Unmodifiable crap
>
> > I can understand this. The reason the classes exist is for
> > completeness and practicality. [collections] has interfaces
> > that are not in the JDK, and they need unmodifiable decorators
>
> Steve, this is where I was wondering about the approach used in the
[events]
> message posted today.  Would that help, if applied consistently across
> [collections]?
Not really. Proxying would require a simple matching straegy.

However, each collection has its own tricks when it comes to writing
decorators. For an unmodifiable map for example, you must trap the main map,
the keySet, the values collection and the entrySet. Plus you must trap the
setValue on exposed MapEntry objects from the entrySet iterator and the
toArray.

Sometime, I think this is what many people looking at collections don't
appreciate. Implementing the collection interfaces, especially the maps, can
be really hard.

Stephen


---------------------------------------------------------------------
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