On 2010-04-19 13:57, Greg Brown wrote: > >> 2. The immutable collection classes (ImmutableList/Map/Set) expose their own >> private List/Set/MapListeners, which makes them completely useless -- never >> will those listeners report any modification. Instead, the methods >> getListListeners(), getMapListeners(), getSetListeners() should delegate to >> the wrapped List/Map/Set instance, so that the users of the immutable view >> still get reported about modifications of the wrapped collection. >> > That would sort of defeat the purpose of the wrapper class. When using > immutable collections, the caller should not still be modifying the > underlying collection. The caller certainly should not be under the > expectation that the immutable collection will fire any events (especially > from a different collection). > >
Might be an interesting idea to make the immutable classes add a listener to their wrapped object and whinge loudly if someone does modify the underlying class. Regards, Noel "fail early, fail loudly" Grandin
