W3C home > Mailing lists > Public > www-dom@w3.org > April to June 1998

Re: Hello and NodeIterator Revisited

From: Peter Sharpe <peter@sqwest.bc.ca>
Date: Fri, 01 May 1998 09:58:10 -0700
Message-Id: <199805011658.JAA12308@sqwest.bc.ca>
To: "www-dom" <www-dom@w3.org>
At 02:05 AM 5/1/98 , Don Park wrote:
>>>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.
>>
>>Part of the reason for doing this was to emulate that familiar behavior of
>>the java.util.Enumeration interface.  We've extended the functionality,
>>certainly, but not the fundamental concept.  Again, I'd be glad to hear in
>>more detail your argument that this would make efficient implementation
>>difficult, and would entertain any better idea.  The "old" way (having
>>iterators point to Nodes) would have caused us to have to define all sorts
>>of ad-hoc behavior if the "current" node was deleted, or modified, or
>>moved, or a new node inserted before or after it, etc.
>
>Rather than trying to explain why the current NodeIterator design is hard to
>implement efficiently in Java, I challenge you to write an efficient
>implementation in Java.  I also challenge you to write example programs
>which benefits substantially from the 'live' NodeIterator design.  Scars are

>easier earned than explained.
>
I don't think you are going to get much sympathy with that kind of argument.
You might not be aware that several of the companies represented on the DOM
WG have had implementations similar to the DOM for years. We have plenty of
scars and we have not put anything into the DOM that we believe it would be
difficult to adapt our implementations to support.

Having said that, I don't think that any of us have actually implemented this
in Java, although there certainly is lots of Java experience in the WG. So if
there are particular requirements for that language that we are not aware of,
then we would very much like to hear about them.

Instead of us implementing iterators in Java to prove your point for you, why
don't you imagine an efficient implementation in C++. If you can't do that
then the language issue is unimportant and we can discuss implementations in
general. On the other hand, if you can but you can't find a way to move the
implementation to Java and maintain efficiency then tell us why.

Peter
---------------------------------------------------------------------------
Peter Sharpe, Chief Scientist, SoftQuad Inc.  Tel: +1 604 585 8394 ext. 312
#108-10070 King George Highway, Surrey, B.C., CANADA V3T 2W4  Fax: 585 1926
Internet: peter@sq.com or peter@sqwest.bc.ca     World Wide Web:
<http://www.sq.com/>www.sq.com  
Received on Friday, 1 May 1998 12:58:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT