[jdom-interest] Can't we all get along? :) -- [is] getChild() vs. getChildElements()

Patrick Dowler Patrick.Dowler at nrc.ca
Wed Aug 2 15:41:31 PDT 2000


On Wed, 02 Aug 2000, James Duncan Davidson wrote:
>      "Ok, so I've got this element which is my <target> element. Now, I want
>      to get all of the elements that are below this which are instances of a
>      <task>... I do that with a get_______________() method call."
> 
>   A: "Ok, so I've got this element which is my <target> element. Now, I want
>      to get all of the elements that are below this which are instances of a
>      <task>... I do that with a getChildren() method call."
> 
>   B: "Ok, so I've got this element which is my <target> element. Now, I want
>      to get all of the elements that are below this which are instances of a
>      <task>... I do that with a getChildElements() method call."
> 
>   C: "Ok, so I've got this element which is my <target> element. Now, I want
>      to get all of the elements that are below this which are instances of a
>      <task>... I do that with a getElements() method call."
> 
> A and B are deadlocked. What about C? It works well enough for me as an
> Element has Children, some of which are Elements, some of which are
> Entities, some of which are PIs, some of which are Comments, etc.

Yesterday I suggested option C - hidden in with my suggestion that the
singular should be just "get(String name)" - simply because "Child" is
superfluous anyway: you aren't expecting getting siblings, parents, or
grand-children with such a call. In addition, you only get elements by name.

I'm in favour of "getElements". For the singular, I'd prefer "get" because I
don't see anything more verbose being any better.

Good analysis of the current state.
-- 

Patrick Dowler
Canadian Astronomy Data Centre


Received: from mail.x180.com (w002.z208176150.sjc-ca.dsl.cnc.net [208.176.150.2])
	by dorothy.denveronline.net (8.9.3/8.9.3) with ESMTP id AAA09320
	for <jdom-interest at jdom.org>; Wed, 2 Aug 2000 00:28:05 -0600 (MDT)
Received: from [192.168.254.13] ([208.176.176.73]) by
          mail.x180.com (Netscape Messaging Server 4.15) with ESMTP id
          FYNJ6Q00.F4A; Tue, 1 Aug 2000 23:25:38 -0700 
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
Date: Tue, 01 Aug 2000 23:27:32 -0700
Subject: Re: [jdom-interest] delicate balance?
From: James Duncan Davidson <james.davidson at eng.sun.com>
To: Joseph Bowbeer <jozart at csi.com>, <jdom-interest at jdom.org>
Message-ID: <B5AD0D61.8352%james.davidson at eng.sun.com>
In-Reply-To: <007901bffbc4$23cf1940$029bfea9 at replicant>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Sender: jdom-interest-admin at jdom.org
Errors-To: jdom-interest-admin at jdom.org
X-BeenThere: jdom-interest at jdom.org
X-Mailman-Version: 2.0beta2
Precedence: bulk
List-Id: JDOM Mailing List for General Issues and Updates <jdom-interest.jdom.org>

on 8/1/00 7:24 AM, Joseph Bowbeer at jozart at csi.com wrote:

> One thing I've noticed as I follow this list: as everyone becomes
> more familiar with the intricacies of XML, they "raise" the bar
> for what passes as small, simple and intuitive.

Yep.. I'd agree with that assessment.

> I think it's hard to pile a lot of development on top of a
> delicate balance. Perhaps we need to decide: Are we trying to
> undercut DOM, getting most of the benefit with little of the
> complexity? Or are we trying to build an accessibility layer on
> top of DOM, preserving everything and making it easier to use at
> the same time?  (I hope my characterization is accurate enough to
> be helpful.)

I'd vote +1 on the first, -1 on the latter (as far as making an
accessibility layer on top of DOM).

If JDOM exposes the XML tree accuratly, that's fine.. It's great in fact as
some peeps want that. And some peeps just want the fast case through to pick
out data. I personally care about the latter (even having been to deeply
innudated in XML of late) -- but if both camps can be satisfied I'll go for
it (assuming that you don't hit performance too badly ;).

.duncan




More information about the jdom-interest mailing list