Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] RFE: Element.appendChild(String text) should return "this" for chaining

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] RFE: Element.appendChild(String text) should return "this" for chaining
  • Date: Mon, 16 Aug 2004 11:36:59 -0700

On Aug 16, 2004, at 10:59 AM, Elliotte Rusty Harold wrote:

I find both code fragments you sent equally opaque. I do not see that method chaining makes this any better.

Bottom line: I'm sorry but method chaining just offends my aesthetic sensibility. It's not going to happen.

appendChild(String text) is already a convenience method that does not provide any functionality that could be achieved otherwise.
What is it intended for?
Unfortunately said convenience method actually doesn't provide convenience for the common case i outlined, and so if the chaining isn't going to happen the entire method might as well not be there as far as i'm concerned.

As an aside, even though it amounts to the same thing, the logical implementation of the current behaviour would be

public void appendChild(String text) {
appendChild(new Text(text));
}

instead of

public void appendChild(String text) {
insertChild(new Text(text), getChildCount());
}





Archive powered by MHonArc 2.6.24.

Top of Page