[jdom-interest] insertChild in Element

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu Aug 31 05:36:32 PDT 2000

> I don't think Element should implement List.  To my mental 
> model, Element ->
> List is not an "is-a" relation, but rather a "has-a".

Absolutely.  For my primary interest in xml, representing hierarchies of
data, calling the list elements Children is quite natural.

> The line:
> 	element.getChildren().add(newElement, 3);
> makes perfect sense. But the alternative line:
> 	element.add(newElement, 3);
> just doesn't feel right.

yes, an add method looks more like it's at the same level, a sibling.

More information about the jdom-interest mailing list