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. 

Received on Wednesday, 6 May 1998 12:33:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:04 UTC