[jdom-interest] Why should I have to detach()?

Kevin Baynes kbaynes at renex.com
Fri Mar 23 09:59:30 PST 2001


> > The only reason I can see for doing that is to make
> > the user explicately aware that they are detaching
> > an element.
>
> I think that is the reason.  Yes you could detach the parent from
> the child.
> But can you automatically detach the child from the parent's content?
> Should you?  To me this is a little reasonable api reminder to pay
> attention.  But then, I haven't had a reason to do it myself!

Do you think that with addContent( Element ), some programmers might expect
the default behavior to act like Element.clone() and others might expect it
to act like Element.detach()? Should JDOM make either assumption?

I prefer the lack of ambiguity.

-Kevin




More information about the jdom-interest mailing list