Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] checkDetach vs. checkRemoveChild

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: jcowan AT reutershealth.com
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] checkDetach vs. checkRemoveChild
  • Date: Tue, 9 Mar 2004 15:32:15 -0500

Elliotte Rusty Harold scripsit:


> checkRemoveChild is parallel to checkInsertChild and there's no
> parallel checkAttach method in Node. Plus checkDetach is inherited by
> more classes than checkRemoveChild so deleting it is a bigger gain in
> API simplicity. Furtheremore, there's an existing assymmetry in the
> code. Calling detach() invokes both checkRemoveChild() and
> checkDetach(). However, calling removeChild() only results in a call
> to checkRemoveChild. checkDetach() is not also called.
>
> Thoughts? Comments?

Since I've started thinking about what an HTML XOM would look like,
I'm going to press for completeness here:

detach, removeChild, and replaceChild should all call
checkDetach on the child and checkRemoveChild on the parent.

insertChild, appendChild, and replaceChild should all call
checkAttach(Node newParent) on the child and checkInsertChild
on the parent.

That allows either the parent or the child to veto changes in their
relationship.

--
All Norstrilians knew what laughter was: John Cowan
it was "pleasurable corrigible malfunction". http://www.reutershealth.com
--Cordwainer Smith, Norstrilia jcowan AT reutershealth.com




Archive powered by MHonArc 2.6.24.

Top of Page