[jdom-interest] Re: Comments on JDOM b10-rc1

Bradley S. Huffman hip at cs.okstate.edu
Wed Feb 11 12:57:34 PST 2004

Jason Hunter writes:

> Elliotte Rusty Harold wrote:
> > Is there some reason Content is not called Node or perhaps Child? To my 
> > way of thinking "Content" refers to a list of all the content, not one 
> > node. This is in keeping with the XML spec which says:
> Well, Node would work (and Parent/Node is a better split than 
> Parent/Content) but if Document is not a Node that breaks the notion of 
> Node.

It was originally Child, because even non-programmers can quickly grasp a
Parent/Child relationship.

> > Are all the overloaded methods in JDOMFactory really necessary? Does the 
> > Builder actually call all of these, or could some of them be cut?
> You raise an interesting question.  Several of the factory methods 
> aren't used internally, and it's true it'd be easier to write your own 
> factory if there were fewer methods to implement.  To do that we'd prume 
> the interface to a single "representational method" for each type.
> There are downsides.  Since our "representational method" would have to 
> be the longest method signature variety, builders or others using the 
> factory will have to pass nulls, Attribute.UNDECLARED_TYPE, and other 
> placeholders for the unused values.  Now, factories can be called by 
> users as well as builders, so this makes user code have to be more 
> complicated in some cases.  I think it's better to make the factory 
> implementation code just slightly more complicated in order to avoid this.

The version of SAXHandler I have on my hard drive only uses the 
"representational methods" FWIW.

> > Finally, I strongly recommend using code coverage tools like Clover or 
> > Jester or both to measure the test coverage before releasing. In my 
> > experience this turns up a huge amount of untested code, unreachable 
> > code, and outright bugs. It's also worth hitting the code base with 
> > static analysis tools like PMD.
> Volunteers most welcome.

Clover cost money. Jester was still running after 20hrs on a old 450Mhz
XP boxes this weekend so I killed it (I think one of the code changes it
made put it in a infinite loop). PMD should nothing really drastic.

I have the .bat file I used for Jester, and the ant file I used for PMD
if anybody wants them.


More information about the jdom-interest mailing list