Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] enhancements

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: dvholten AT computer.org
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] enhancements
  • Date: Tue, 07 Dec 2004 13:18:48 -0500

dvholten AT computer.org wrote:

hi there,

as you discuss technical performance matters, i'd like to throw in some
more 'stylistic' enhancements:

i propose these changes in xom/Attribute.java enumeration class 'Type':
- drop int member ' type' - add String member 'name' (i propose 'final String' as it is immutable)
- change constructor (and constructor calls) to accept the symbolic names
- drop switch statement in getName(), just return name
- change hashCode() to return name's hashCode


Might be marginally clearer, and makes no external changes However there are some issues:

1. Some parsers do not return the standard names they're supposed to. I cannot promise that the name passed into such a constructor is indeed one of the ten legal names. I can probably work around that but

2. The names passed in might not be equal in multiclassloader situations.

Again, I can probably work around all this, but it's not clear why I should. What would be gained by doing this? I don't think the current version is all that complex.


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page