views:

94

answers:

4

Someone recently asked on IRC about the history of XML parsing and WS APIs in Java, and I started wondering. Is there any written history? What are the latest and coolest toys? Why are there so many?

Usually knowing the history of why things were developed and how they are supposed to improve over their predecessors helps learning the new and good stuff, so a good, thorough answer to the questions posed above might even be useful!

A: 

DOM and SAX came out first, way back when, together I think. Then eventually StAX came out, which is definitely an improvement over SAX in that it works in pull mode, like compilers always have.

Why are there so many tools? Because everything needs to be over-engineered in the java world.

Jeremy Huiskamp
There is also vtd-xml, which is worth mentioning :)
vtd-xml-author
A: 

For webservices in java, Sun came out with their initial API where everything was very manual, then Apache came out with the axis project, which initially could create only static stubs, then JAX-WS came out, which supported annotations.

For a history of what happened when you can look at the history of the tutorials for web services, as they mention JAX-RPC, which I had forgotten about: http://java.sun.com/webservices/docs/2.0/tutorial/information/history.html

James Black
+1  A: 

Some comparisons and a short history of JAX-RPC/JAX-WS. I think the article muddled the data binding differences a little. JAX-WS currently uses JAX-B 2.x. JAX-B 2.x is vastly different from JAX-B 1.x and other implementation bound binding tools like Castor. This article covers the differences between JAX-B 1.x and JAX-B 2.x in more detail. If you really want to appreciate the differences, you need to look at the generated code and appreciate the portability of JAX-B 2.x annotated POJOs.

Any discussion of Java and XML would be incomplete without mentioning JAX-P. Here is a presentation from Java One on the history of JAX-P.

Also of importance is the evolution of SAAJ. The biggest evolutionary step I can remember for SAAJ is when it moved to extend DOM such that your handlers could easily interact directly with the RAW SOAP message XML.

There is also the history of bundled JAX-P, JAX-WS, and JAX-B implementations in the Sun JVM. This FAQ goes over some details of the bundled implementations of JAX-P and how to override them. If memory serves me correctly things started out with Crimson and Saxon being bundled (or at least being the reference implementations) and now Xerces and Xalan are bundled in the Sun distributions. The JAX-WS and JAX-B RIs from Metro are also bundled these days. The version of each bundled API and implementation depends on the major (and occasionally minor) version of the JVM you are using. Your app server will also likely throw its own implementation into the mix just to ruin your day. The endorsed standards override mechanism will be your friend in many of these cases. The config files and/or system properties for defining your SAAJ and JAX-P factory implementations will also be useful.

DavidValeri
I think this is pretty close to what I was after.
Tuure Laurinolli
A: 

There are so many because there is no "best" out yet in everyone's opinion. Simple as that.

They're almost all memory hogging and opaque. At least I like Xpath whenever I just want to get the values out of a XML document. Further I would like any XML tool following the builder pattern whenever I want to construct a XML document. For example XMLBuilder or XMLTool at Google Code.

BalusC