[jdom-interest] [benchmark] JAXB VS JDOM

Trikannad, Mahesh mahesh.trikannad at capgemini.com
Wed Apr 13 13:17:32 PDT 2005

I was referring to the Binding and Unmarshalling in JAXB.

I was looking at the article from Sun.


Here are some excerpts

Binding a schema means generating a set of Java classes that represents
the schema. All JAXB implementations provide a tool called a binding
compiler to bind a schema .

Unmarshalling an XML document means creating a tree of content objects
that represents the content and organization of the document. The
content tree is not a DOM-based tree. In fact, content trees produced
through JAXB can be more efficient in terms of memory use than DOM-based

The content objects are instances of the classes produced by the binding
compiler. In addition to providing a binding compiler, a JAXB
implementation must provide runtime APIs for JAXB-related operations
such as marshalling. The APIs are provided as part of a binding
framework. The binding framework comprises three packages

>From the article, it seems like, classes are created offline. Agreed no
Objects are created, so my statement that a DOM Tree is created offline
is not strictly correct. I meant to say, it probably creates the classes
or inheritance structure before hand.



-----Original Message-----
From: Elliotte Harold [mailto:elharo at metalab.unc.edu]
Sent: Wednesday, April 13, 2005 3:53 PM
To: Trikannad, Mahesh
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] [benchmark] JAXB VS JDOM

Trikannad, Mahesh wrote:

> My reasoning, for JAXB being faster, is since it creates the DOM tree

> compile time, the run time overhead of creating the tree doesn't

> or traversing a tree , does not exist.

> Why do you think it makes no sense.

Because JAXB doesn't do what you think it does. Indeed it can't. It does

not create the DOM tree at compile time. No objects of any type are ever

created at compile time in Java. JAXB creates a tree at runtime when it

sees the document, just as JDOM does. It may use different classes and

parsers in the tree it creates. Indeed JAXB may create some data

structure that is not a tree at all. But whatever it does, it does it at



Elliotte Rusty Harold  elharo at metalab.unc.edu

XML in a Nutshell 3rd Edition Just Published!



This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,  distribute, or use this message or any part thereof. If you receive this  message in error, please notify the sender immediately and delete all  copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20050413/46af544e/attachment.htm

More information about the jdom-interest mailing list