Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] static Builder.create methods instead of constructors?

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: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] static Builder.create methods instead of constructors?
  • Date: Thu, 12 Aug 2004 07:20:47 -0400

Question: Would it perhaps be better to have static Builder.create methods instead of constructors?

I don't want to make any such large change at this late date.

That way one would gain a little flexibility in how/what kind of builder is returned. For example,
one could (in some later XOM release) conceivably return a builder from a thread local pool or similar (recognizing that constructing the underlying XMLReader of a Builder is an extremely expensive operation; takes 2 milliseconds or more).

2 ms is not a long time for an operation that happens approximately once per thread. Builders are intended to be reusable in series. You should not need to create a lot of them.
--

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