Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Re: XOM 1.0d23 Last Call

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: Bill de hÓra <bill AT dehora.net>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Re: XOM 1.0d23 Last Call
  • Date: Tue, 10 Feb 2004 08:08:23 -0500

At 9:47 PM +0000 2/9/04, Bill de hÓra wrote:

I consider namespace scenarios convenience clutter for the most part. But then again, with this line of thought, most OO methods are convenience clutter including getChildCount (why not just compute the count?).

Because it would be hugely more expensive. getChildCount() is O(1). Iterating through the elements until you got the last one would be O(N) with a big juicy multiplier for catching the exception. getChildCount() is more convenient, faster, and more consistent with good OOP principles. (Specifically use exceptions ionly for exceptional cases.)

--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page