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 16:46:07 -0500

Elliotte Rusty Harold scripsit:

> Can you explain why you think checkDetach() is necessary for this
> use-case? It's not obvious to me.

Well, within a single package of XOM subclasses, it's redundant
to have checkAttach and checkDetach, because you can always use
the double-dispatch pattern: the parent can ask the child via a
package-private interface "Do you want to be attached to/detached
from me?" Where it gets important is when multiple packages are trying
to interact, since the parent has no way to get the child's input on
the subject. In addition, if you subclass Comment, PI, or Text, then
checkAttach/checkDetach is the only way for any of them to get into
the act. But I find it hard to imagine that anyone would care.

I agree that if you're only going to keep one, you should keep the parent
check, since typically parents care more about who their children are
than vice versa.

--
BALIN FUNDINUL UZBAD KHAZADDUMU jcowan AT reutershealth.com
BALIN SON OF FUNDIN LORD OF KHAZAD-DUM http://www.ccil.org/~cowan




Archive powered by MHonArc 2.6.24.

Top of Page