[jdom-interest] More changes

Brett McLaughlin new.instance at gte.net
Wed Jul 19 08:35:40 PDT 2000


OK folks... some more food for thought:

* Anyone having a problem with removing getCharContent() (both default
and non-default version) in Element.java? It doesn't really behave the
same as the rest...

* What do people think about removing the convenience methods (like
getIntContent()) on Element.java? Mark Diekhans pointed out that getting
a default value from an attribute is quite different from getting one
from an Element - typically, it means the Element is optional, or not
there, but we also return the default if the /format/ is incorrect.  For
example:

<port>yl7</port>

getPort(80); 

This currently returns 80, and should really result in an error - it
masks problems in the underlying XML, which is generally a bad thing, I
think. It is very hard to track this down, and different programs using
different defaults can really obfuscate the document. So I'm actually
for removing all the getXXXContent methods (but only on Element.java,
not Attribute.java, where they make more sense).

* When you do 

List kids = element.getChildren();

Do you expect the list to be live? For example, if you add kids to an
element in the list, of course it works normally. However, if you add or
remove children from the list, do you expect those to automatically
cause removal of the children in the List? Or do you not expect it to
take place (the removal or addition) until you do
element.setChildren(kids); and reset the list with the modified one?
This is a key point I would like to get feedback on, and decide if what
we are doing is right. If not, we can remove PartialList, and really
simplify things. Additonally, it makes traversal much less
object-intensive.

Thanks,
Brett

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org



More information about the jdom-interest mailing list