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

Re: Hello and NodeIterator Revisited

From: Vidur Apparao <vidur@netscape.com>
Date: Wed, 06 May 1998 09:33:52 -0700
Message-ID: <355090EF.8440D4C7@netscape.com>
To: Don Park <donpark@quake.net>
CC: www-dom@w3.org
Don Park wrote:
> The problem is that the current design directly causes faulty implementation
> in Java.  One specific interface I am concerned about is NodeIterator.
> Latest change made it impossible to implement it without causing unused
> NodeIterators to pile up.  The choice is to either change the API again to
> relieve the need to keep track of NodeIterators from Node or add 'release'
> method to NodeIterator.

My impression is that you could use weak references in Java (see
java.lang.ref.WeakReference) to deal with your accumulation problem. Your Node
implementation could hold on to its NodeIterators using weak references. The
NodeIterators would be GC'd when the last "external" reference was dropped. 

--Vidur
Received on Wednesday, 6 May 1998 12:33:57 GMT

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