Hello and NodeIterator Revisited

Hello there.

I would like to point out some of the problems of the NodeIterator design.

1. Mixing iteration operation with indexing operation is not a good.  It is
confusing as well as burdening the implementors unnecessarily.

2. Implementing the 'between' concept of position is elegant but makes
efficient implementation in Java very hard if not impossible.  Due to 'live'
aspect of iterators, each iterator has to be attached to the 'link' between
two siblings.  Cost of object instantiation is heavy in Java.

3. NodeIterator should have a 'release' method to make it possible for the
target node to keep track of active iterators.  C++ has destructor, Java's
finalize is less than useless.

4. Using NodeIterator to iterate an element's Attribute is not wise since
most of the Node methods do not make sense if Attribute interface extends
Node interface.

Frankly, I would prefer the 3/18 version of NodeIterator minus 'live' data
structure as well as getCurrentNode.  If nodes are reference counted, who
cares if is removed or not.  But then I would prefer to have the API settled
down more than anything.  Tennise match without short skirts gets boring
real fast.

That is all for now.

Don Park
http://www.docuverse.com/personal/index.html

Received on Thursday, 30 April 1998 15:44:28 UTC