You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Lee Crawford <cr...@weaselworks.com> on 2003/11/07 04:50:13 UTC

[collections] review of the collections/iterator package.

Greetings. In advance of submitting a collection of iterator-related
classes, I thought I'd review what was already in the
org.apache.commons.collections.iterators package to ensure my components
would fit in. 

I wanted to share my observations and try and discuss some of the areas
that I had an opinion on. 

  1) It seems like the ProxyIterator class should be more of a base
interface for Iterators that have embedded, accessible Iterators in
them. Many of the classes in the package would implement this interface.
A ProxyIteratorImpl or AbstractProxyIterator class could be provided as
a concrete implementation. 

  2) The same thing could be said for the ProxyListIterator class. 

  3) If you didn't agree with the above and ProxyIterator and
ProxyListIterator remain concrete classes, why don't all of the
delegating Iterators in the package extend these base classes? For
ProxyIterator you've got AbstractIterator, UnmodifiableIterator,
TransformIterator, etc. 

  4) In the case of ProxyListIterator why don't the classes like
AbstractListIterator, UnmodifiableListIterator, etc. extend it? 

  5) The AbstractListIterator class seems to do the same exact thing as
ProxyListIterator? 

  6) The AbstractIterator class seems to do the same thing as
ProxyIterator? Also, it seems to be functionally duplicated in the
../decorators package. 

  7) Why isn't there a ProxyMapIterator class similar to the
ProxyIterator and ProxyListIterator classes? 

  8) If there was then UnmodifiableMapIterator should extend it. 

  9) Why doesn't the SingletonListIterator class extend
SingletonIterator instead of reimplementing the base functionality? 

Any comments, explanations, etc. greatly appreciate. Thanks all. 

--lee



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