Welcome!

SOA & WOA Authors: Trevor Parsons, Andreas Grabner, Elizabeth White, Pat Romanski, Ashley Stephenson

Related Topics: SOA & WOA

SOA & WOA: Article

XML Binding Frameworks in the Context of Service-Oriented Architecture

Make an informed choice about a binding framework for your SOA needs

XMLBeans (http://xmlbeans.apache.org): XMLBeans uses XML Schema to compile to Java interfaces and classes that allow modification of XML instance data. XMLBeans provides setter and getter methods like JavaBeans. XMLBeans distinguishes itself by fully supporting XML Schema. During demarshalling an XML instance the full XML infoset is kept and is available to the developer. This is critical because a subset of XML is not easily represented in Java, e.g., the order of elements or comments might be needed in an application.

JAXB (www.java.sun.com/xml/jaxb): JAXB is a standard for XML binding and consists of two parts. First, JAXB contains a compiler that reads a schema and produces the equivalent Java object model. This generated object model captures the structure of XML better than general-purpose APIs like DOM or SAX, making it a lot easier to manipulate XML content.

The second part is an API, through which applications communicate with generated code. The JAXB implementation from SUN JWSDP1.5 is used.

Quantitative Evaluation of the Frameworks
We have quantitatively evaluated the XML binding frameworks on the following parameters.

  1. Marshalling Time - Marshalling is the process of generating an XML representation for an object in memory. As with Java object serialization, the representation needs to include all dependent objects: objects referenced by our main object, objects referenced by those objects, and so on.
  2. Demarshalling Time - Demarshalling is the reverse process of marshalling; it builds an object (and potentially a graph of linked objects) in memory from an XML representation.
  3. Memory Load - JVM Heap memory used for the whole process of marshalling and demarshalling using the respective XML binding frameworks.
Performance Tests
The test run used three samples of XML varied by its nature (segmentation factor). The test cases had to execute the selected binding frameworks on the sample XML files serially some x number of times. In addition to these, x number of threads have been executed concurrently. The combination of these test scenarios is an indicator of the memory load on a platform and time statistics of each of these utilities (see Table 1).

Test Suite
The JProbe profiler and Memory Debugger have been used to capture the performance, memory, and threading coverage issues of the respective binding frameworks. Each test case is run as a stand-alone session to have snapshots of the performance captured for each program execution. The tests are performed on a system with the following configuration:

  • Pentium IV 1.8 GHz
  • 512 MB RAM
  • Virtual Memory: 768 MB
Quantitative Results
Marshalling Time

The graphs in Figures 4.1-4.4 represent the marshalling performance for simple and complex XML respectively. Higher performance from JiBX is due to the byte code enhancement done at the compile time. It avoids introspection at runtime.

As seen from Figures 4.3 and 4.4, for multiple concurrent threads the results for XMLBeans worsen, whereas JiBX on the other hand has the same pattern.

Demarshalling Time
Refer to Figures 4.5 and Fig 4.6. Castor provides good support for data binding using code generation, but demarshalling performance is weak compared to others. The graph pattern is similar in the case of concurrent runs.

Castor uses the SAX2 parser and parses the XML file in an event-driven manner, thus reducing its speed and performance as compared to JiBX.

JiBX uses XMLPull parsing technique, unlike the push parsing techniques such as SAX. Instead of the parser calling methods in the handler to report document components, one calls the parser to get each component in turn.

Memory Load
Memory load over the entire run (composed of demarshalling marshalling) is low for JiBX as it uses the XMLPull parsing technique during demarshalling, which doesn't require the parser to maintain the state in the document. Castor uses the SAX2 parser, which requires the parser to maintain the state in the document. JAXB is relatively inefficient in terms of memory usage.

Inferences
From the performance analysis of the four data-binding frameworks, a SWOT analysis is presented in Figure 5. Based on information from Figure 5 and from the performance charts seen earlier, JiBX outperforms all of the other binding frameworks by a wide margin on both time and memory usage. JAXB scores well on marshalling and demarshalling time, but its memory usage is higher than the others. XMLBeans has a major performance hit but is more memory-efficient than Castor and JAXB. Depending on the specific requirement of an application, a suitable XML binding framework can be chosen.

Summary
We have illustrated in this article the pivotal role XML binding frameworks can play in context of SOA. To enable practitioners to make an informed choice about the appropriate XML binding platform, we have carried out a detailed quantitative analysis of some of the popular XML binding frameworks in the J2EE context, and presented the results.

References

More Stories By Dr. Srinivas Padmanabhuni

Dr. Srinivas Padmanabhuni is a principal researcher with the Web Services Centre of Excellence in SETLabs, Infosys Technologies, and specializes in Web Services, service-oriented architecture, and grid technologies alongside pursuing interests in Semantic Web, intelligent agents, and enterprise architecture. He has authored several papers in international conferences. Dr. Padmanabhuni holds a PhD degree in computing science from University of Alberta, Edmonton, Canada.

More Stories By Bijoy Majumdar

Bijoy Majumdar is a member of the Web Services COE (Center of Excellence) for Infosys Technologies, a global IT consulting firm, and has substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. Prior to Infosys, Bijoy Majumdar worked as an IT Analyst, and had been a member of the GE Center of Excellence (e-center) under the E-Business Practice of Tata Consultancy Services.

More Stories By Ujval Mysore

Ujval Mysore is a member of the Web Services COE (Center of Excellence) for Infosys Tehcnologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies. Dr. Srinivas Padmanabhuni heads the Web Services COE.

More Stories By Vikram Sitaram

Vikram Sitaram is a member of the Web Services COE (Center of Excellence) for Infosys Tehcnologies, a global IT consulting firm, and have substantial experience in publishing papers, presenting papers at conferences, and defining standards for SOA and Web services. The Web Services COE specializes in SOA, Web services, and other related technologies. Dr. Srinivas Padmanabhuni heads the Web Services COE.

Comments (2) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
tejasvi 08/12/05 12:13:44 PM EDT

this article is excellent

XML News Desk 08/02/05 04:46:17 PM EDT

XML Binding Frameworks in the Context of Service-Oriented Architecture. This article critically evaluates the role of XML binding frameworks play in the context of service-oriented architecture (SOA) platforms, and it also provides an objective evaluation of the popular XML binding frameworks in a J2EE environment.