Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Builder argument swap

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold - java FAQ <elharo AT metalab.unc.edu>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Builder argument swap
  • Date: Fri, 19 Mar 2004 12:08:22 -0500 (EST)

Yesterday, I gave a talk about XOM at Software Development 2004 West. The
notes are here:

http://www.cafeconleche.org/slides/sd2004west/xom/

During the talk I noticed a couple of things I'd like to change:

1. I think I can delete the abstract toString() method in Node. All nodes
have toString anyway because Object does, and the actual implementations
in the subclasses won't change. I don't think this will actually break any
code. The main advantage is that I reduce by one the XOM score in the
table comparing the number of methods in DOM, JDOM, and XOM. (This is
like golf. Low scores are good.)

2. This is the serious one. There are currently these two methods in
Builder:

public Document build(String systemID);
public Document build(String document, String baseURI);

Yesterday it occurred to me that the second one is backwards. In keeping
with the general principle of overloading methods by adding successive
arguments (Does anyone have a reference on that?) I think these should be:

public Document build(String systemID);
public Document build(String baseURI, String document);

Then, maybe one of the arguments should be renamed; e.g.

public Document build(String systemID);
public Document build(String systemID, String document);

or

public Document build(String baseURI);
public Document build(String baseURI, String document);

or perhaps just:

public Document build(String uri);
public Document build(String uri, String document);


So I have two questions:

1. Does anyone want to argue in favor of not flipping the arguments?
2. What should the name of the first argument be? baseURI, systemID, uri,
or something else?

--
Elliotte Rusty Harold
elharo AT metalab.unc.edu
elharo AT macfaq.com





Archive powered by MHonArc 2.6.24.

Top of Page