Level 2 iterators

The editorial comment says it all,

> (ED: The fix-ups required by this model complicate 
> implementation somewhat, but make life simpler for the 
> user of iterators.

This looks like 'live' NodeLists all over again ...

Let's allow, for the sake of argument, the view that
DOM users would have difficulties with iterators which
could be invalidated by tree mutation ... I've
expressed doubts on this score before but there's no
point rehearsing them again now.

We need to be clear, tho', exactly what the cost of
these safe iterators is. It's _not_ going to add much in 
the way of _programming_ complexity for DOM implementers 
... any DOM implementation which supports level 1
NodeLists will have all, or most, of the infrastructure 
needed to support iterator fixup as described in the 
current draft.

The increase is in complexity in the big-oh sense ... 
that is, fixups (and even notifications of invalidation)
have serious performance consequences, either for 
next/prevNode(), for tree mutation operations, or both.
For those of us wanting to use the DOM on the server-
side this is a serious issue, and would probably rule 
out the use of iterators in the same way that it now 
rules out the use of NodeLists. Worse still, it could 
also rule out the use of current or future APIs that are 
specified in terms of NodeIterators.

But it doesn't have to be this way. NodeIterator is an
interface, and as such can have implementations with
differing characteristics. The spec should be amended
to allow for more lightweight implementations (currently
it can only be read as requiring that any and every
NodeIterator implementation support fixup), even if the 
default implementation behaves as currently described 
for hand-holding purposes (however spurious).

Cheers,


Miles

-- 
Miles Sabin                          Cromwell Media
Internet Systems Architect           5/6 Glenthorne Mews
+44 (0)181 410 2230                  London, W6 0LJ
msabin@cromwellmedia.co.uk           England

Received on Thursday, 4 March 1999 13:11:16 UTC