RE: Alternative to the Live NodeIterator

At 09:31 AM 5/1/98 , Andrew n marshall wrote:
>Yes.  This is an excelent way to create the iterator class proposed in the
>spec.  In fact, this is very similar to the Visitor model Don Park mentioned.
>
>My point is it requires the document tree to have a reference to the Iterator
>so this update can be made.
>
Right. Some object -- and the document tree is a logical choice -- must
maintain a reference to iterators.

But I thought you were also arguing that maintaining these references would
be very expensive. I was claiming that there are implementations where, in
fact, it isn't very expensive at all.

>And as Don Park also mentioned, these reference need a release mechanism.
>
In the subset of language bindings which garbage collect -- I'll include
ECMA Script and COM in that category -- I don't believe there is a
requirement for adding a release mechanisms to the DOM API. Doesn't Java
also fall into the same category?

To be clear about this, an iterator can have the same lifetime as the
document itself, regardless of how many editing operations have taken
place. So the only reason for the DOM API to have a release mechanism
for iterators would be to support languages that don't garbage collect
so that a programmer who is worried about memory usage can do his own
collecting.

Personally, I would rather not add memory management to the API. But I'm
keeping an open mind on the subject.

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 14:00:59 UTC