[jdom-interest] getChild() vs. getChildElements()

Jason Hunter jhunter at collab.net
Mon Jul 31 01:28:47 PDT 2000


> etc. It should very clearly be:
> 
> getChildElement()
> getChildElements()

-1

I had a long explanation written, then my mailer crashed, and it's too
late and I'm too tired to recreate the message.  But... as someone who
*uses* the API, I want the method names to remain convenient.  This is
an API for the programming geeks, not the XML geeks.  They already have
DOM.

The goal with getChildElement() is to reduce confusion for the new user
(probably not necessary since we had zero jdom-interest questions about
this from new users) at the cost of convenience for the regular user.  I
do see your point, but I'm not willing to give up my convenience.  With
getChildElement() the method I would use most would have to be named
getChildElementTextTrim() and about the 10th time I call that method in
a row (since you call these accessor methods a lot) I'm going to get as
fed up with JDOM as I was with DOM.  Well, maybe not *that* annoyed, but
close.  :-)

I was willing to listen to what other users said and would have been
swayed had we seen a groundswell of support for the change.  I would
have figured maybe I was just crazy.  But among the list members who
commented the majority wanted the name to stay getChild(), 4 to 3.  And
because among the ones wanting the getChild() name was James Davidson
(Java/XML guy at Sun, JAXP spec lead, for those who don't know), that
makes me even more inclined to keep the status quo.

-jh-



More information about the jdom-interest mailing list