[jdom-interest] getChildren() vs getElements()

Will Glozer will.glozer at jda.com
Fri Sep 15 12:38:39 PDT 2000

I agree completely, getChild()/getChildren() is more 
understandable and clean imho.  It is nice to have
verbose method names, but there is a point when it
becomes far too verbose.


-----Original Message-----
From: Jason Hunter [mailto:jhunter at collab.net]
Sent: Friday, September 15, 2000 11:56 AM
To: philip.nelson at omniresources.com
Subject: Re: [jdom-interest] getChildren() vs getElements()

> Here I can agree with getChildElements() because we are 
> still consistent with the name getChild() which returns a 
> (strongly typed) Element wheras getChildren() returns a List 
> of Objects and only the docs can tell you what to expect.

The proposal isn't:


The proposal is:


The former wouldn't be consistent.  One problem with the latter is it's
almost *too* consistent and hard to differentiate.  It's one reason I
prefer getChild() / getChildren().  I also prefer it because it leaves
the option to have getChildTextTrim() which I find really useful.  If we
go with getChildElement() then it'd be getChildElementTextTrim() and
that's just too many nouns to be understandable.

To control your jdom-interest membership:

More information about the jdom-interest mailing list