XOM Design Principles


XOM Design Principles

Elliotte Rusty Harold

Extreme Markup Languages 2004

Wednesday, August 4, 2004

elharo@metalab.unc.edu

http://www.cafeconleche.org/


A few opinions

XML was, as has been fretted over before, ugly, hard, and boring to code with. Not any more :). XOM rocks! I'm using it in all my projects now.

Keep it up!

--Patrick Collison


I did some XML Programming during the last month with Java's DOM. this was not funny !! I also played with Ruby's powerful REXML. this is a great API becaue it uses the power of Ruby and it was designed for Ruby and is not a generic interface like DOM. this is way REXML is so popular in the Ruby world.

and this is why I like XOM. for me it fits much better to Java than DOM. I hope that XOM will become for Java what REXML is for Ruby now.

--Markus Jais


Overall, I found XOM to be an amazingly well-organized, intuitive API that's easy to learn and to use. I like how it reinforces good practices and provides insight about XML -- such as the lack of whitespace when XML is produced without a serializer and the identical treatment of text whether it consists of character entities, CDATA sections, or regular characters.

I can't compare it to JDOM, but it's appreciably more pleasant to work with than the Simple API for XML Processing.

--Rogers Cadenhead


i spent yesterday writing the code to render my application config as xml. using xom was like falling off a log. no muss, no fuss, the methods did what i expected, and any confusion was quickly ironed out by a visit to the (copious) examples, or the javadocs. i did run into what might be a bug, but it only showed up because i made a dumb cut-n-paste error (see my other email).

after i get the output tidied up, i'll move on to reading it back in. i'm confident that that will be almost as easy...

--Dirk Bergstrom


Why Me?


Four Styles of XML API


DOM


DOM Ugliness


What I learned from DOM


JDOM


Is JDOM too Java-centric?


What I learned from JDOM


dom4j


Conclusion: We can do better


nu.xom: A New XML Object Model


Design Goals


XML Principles


Design Principles


Principles of API Design


Java Design Principles


Development Style


Performance


How does XOM differ from JDOM?


In JDOM's Favor


In XOM's Favor


XOM is simpler!

Number of public methods (and constructors) in DOM2 JDOM b10 XOM 1.0d25
Node 25 6 * 11
Attribute 5 28 21
Element 16 78 37
ProcessingInstruction 3 16 9
Comment 0 7 9
Builder N/A 33 ** 16
Document 17 43 13

* Content

** SAXBuilder


Current version


Props


To Learn More


Index | Cafe con Leche

Copyright 2004 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified August 3, 2004