DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5967>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5967

DOM-IDOM Integration





------- Additional Comments From [EMAIL PROTECTED]  2002-03-19 13:58 -------
Just post Lenny's response in the mailing list for other Bugzilla users' 
reference:
--------------------------
Hi Tinny,

For some reason, Bugzilla will not complete a commit of my response comment,
so here it is.  Perhaps you can add it.

You asked:

Lenny,  I was reviewing your patch, and have a question.  Your DOM wrapper
keeps the lightweight smart pointers, and use IDOM implementation
internally.
Since the reference counting is eliminated, so who is going to delete the
IDOM
document that is used internally by the wrapper??  How does the memory
management work?

My response:

Good question.  The general answer is that each implementation gets to use
its own memory model.  The base IDOM  classes are common to all
implementations, and each can use, or not use, the addRef/removeRef calls as
they need.  I neglected to think through the needs of the current (default)
IDOM implementation classes, but with the  understanding gained from the
updated IDOM documentation I would make the following recommendations.

1. Add reference counting to IDDocumentImpl so that it will be deleted
automatically when it is no longer used.
2. Add reference counting to all other nodes, but only use it if the node
has no parent node.  In other words, once  a node is part of a document, its
memory is managed by that document, not independently.  Reference counting
is only incurred for non-owned nodes.

With these two changes, users no longer have to be concerned with explicitly
deleting unused documents or non-owned  nodes.  It is all an implementation
detail that is hidden behind the DOM wrappers.

Lenny

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to