[jdom-interest] insertChild in Element
tjenkins at devis.com
Wed Aug 30 12:12:52 PDT 2000
> -----Original Message-----
> >All these things are easily done with the List returned by getChildren()
> >using standard Java APIs. I think it's better to give people access to
> >the List for them to manipulate as they like than reproduce all the List
> >functionality in Element.
> Lately I'm not so sure of that. Certainly, the getting the children
> and then operating on the list doesn't seem to be obvious. What if
> Element and Document implemented List instead of containing a List?
> Would this be more obvious? Would it be more closely reflect people's
> mental models of XML elements?
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".
makes perfect sense. But the alternative line:
just doesn't feel right.
More information about the jdom-interest