> 1. You could move org.apache.pivot.util.ImmutableIterator to package 
> org.apache.pivot.collections.immutable.

This is not a bad idea - I don't feel terribly strongly about it either way.

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

The reason that the immutable collections still return a listener list is 
simply for API consistency. For example, I may want to use an immutable List to 
back a TableView. The TableView doesn't know that the list is immutable, it 
only knows that it is a list.


Reply via email to