[jdom-interest] detach() [eg]

Kenworthy, Edward edward.kenworthy at exchange.co.uk
Thu Apr 26 07:24:26 PDT 2001

In your humble opinion.

Randomly messing with api just to get your pet fix is not the ideal
solution, especially when a better solution that deals not just with this
issue but all and any methods that could put the document in an invalid
state is available.

Throwing an ISE when the document is in an invalid state is the right thing
to do, regardless of the debate over detach(). A document with it's root
removed should also throw an ISE. How does your solution address that ? It
doesn't. Rather than looking at only the small picture (detach) a good
solution would address all similar issues in one consistent approach.

Throwing an ISE does this.

-----Original Message-----
From: Elliotte Rusty Harold [mailto:elharo at metalab.unc.edu]
Sent: 26 April 2001 14:57
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] detach() [eg]

At 10:10 AM +0100 4/26/01, Kenworthy, Edward wrote:

>Secondly, changing the behaviour of detach() in the way Elliotte has
>suggested, whilst ideal if we were starting from scratch, will break
>existing code and would cause considerable confusion. Modifying the
>to throw an ISE maintains all existing code.

This is a spurious argument. The detach() wasn't even present in beta 
6. If we take it out between beta 6 and beta 7 I see no problem. 
Personally, I'm of the opinion that the entire API should be up for 
grabs and subject to change with no concerns for backwards 
compatibility until we declare something 1.0. I certainly don't think 
a method that simply got checked into CVS one day is necessarily 

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
To control your jdom-interest membership:

More information about the jdom-interest mailing list