From The Founder and Senior Analyst of ZapThink

Ron Schmelzer

Subscribe to Ron Schmelzer: eMailAlertsEmail Alerts
Get Ron Schmelzer: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Related Topics: Java EE Journal, Apache Web Server Journal, XML Magazine, SOA & WOA Magazine

J2EE Journal: Article

XML Binding Frameworks in the Context of Service-Oriented Architecture

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

Semantic Interoperability among stakeholders in SOA
Semantic Interoperability reflects the need for different stakeholders in SOA (service requestors and service consumers) to share a common understanding of the documents/data items interchanged. In the recent past, a lot of business communities have come together to define vertical-specific semantic vocabularies in XML abstracting for all of the typical objects and documents of that vertical, e.g., XBRL is an XML standard for financial reporting. To enable service requestors and service providers to process these XML standards-based documents, XML binding frameworks are key to providing a standardized set of IT functionalities in any vertical, especially in those domains where such standards are mainstream.

XML-based data sharing and persistence
In certain situations, data in the form of XML needs to be shared among multiple participants in an SOA. For example, the data from an XML database may need to be accessed by multiple services. XML binding frameworks will enable an easier way for the services, especially those hosted on a similar platform, to access the data. In any situation in which an XML-based Common Information Model of an enterprise needs to be enforced, XML binding frameworks can significantly ease the deployment by providing an easier way to use the API.

Shared Data Services
Shared Data Services (SDS) enable SOA at the data layer by providing a layer of abstraction on top of various data repositories that allow client applications to access these data repositories. Since it is a shared service, it allows reusability and interoperability.

One of the key data formats for working with SDS is XML Schema. The underlying database serving an SDS platform is either a native XML database or a relational database. An XML binding can be used to push data into/from a native XML database or to pull/push data from a relational database accompanied with mapping to/from an XML schema

A Characterization of XML Binding Frameworks
Having established the vitality of XML binding frameworks in an SOA context, we'll first dissect the typical XML binding frameworks.

Many XML binding frameworks are focused on code generation from XML Schema. Using this approach, the starting point is a schema grammar for the documents to be processed, and then you use the binding framework to generate the target source code. The object model or document constructed from a schema can provide a fast way to start working with documents. This can be classified as a document-centric approach.

An alternative approach would be to use the mapped binding in a target language. It works with classes you define in your application in the target language rather than using a set of generated classes based on a schema. This is more of an object-centric approach. This is convenient for the developers because of the closeness of the programming component to the target language.

Most of the conventional applications however stress working with the data, with XML only as a potential form for enabling data to be available to services or applications. These applications are bothered about the consistency of the data rather than the structure of the schema. Such usages of XML binding frameworks can be termed as data-centric.

Figure 2 illustrates a schematic mapping of potential usages of these categories in the context of different SOA applications. Figure 3 shows a summary of the characteristics of the approaches.

Data warehouses and database applications in SOA, e.g., Shared Data Services, can be highlighted as constituting the data management layer, and hence tend to concentrate on a data-centric use of XML binding frameworks. Similarly B2C, intranet, and Internet applications that stress business logic that deals with business entities, constitute the business layer. Typically the business layer applications can be thought of as using an object-centric approach to access the entities, though in some cases a document-centric approach can be used.

Integration and B2B trading applications in the context of SOA that need to exchange contracts/schemas will likely use the document-centric approach.

Some Key XML Binding Frameworks
We will be evaluating some key J2EE XML binding frameworks. A rough categorization of these frameworks is also shown in Figure 3. The frameworks are as follows.

Castor (www.castor.org): Castor XML can marshal almost any "bean-like" Java object to and from XML. The marshalling framework uses a set of descriptors to describe how an object should be marshaled and demarshalled from XML. Castor performs marshalling and demarshalling using Source Generator, which creates a Java object model and provides the binding to marshal, demarshall, and validate instances of XML schema. The source code generator takes as input XML schema document and produces the Java object model pertaining to the specifications of that schema.

JiBX (www.jibx.org): JiBX provides binding from XML data to Java objects. The binding is specified using a definition document, and JiBX uses a binding compiler to compile the definitions into Java byte code for efficiency. JiBX is designed for high performance.

Once the definition is ready, the binding compiler enhances binary class files produced by the Java compiler, adding code to handle converting instances of the classes to or from XML. The enhanced class files generated use a runtime component both for demarshalling and marshalling. The runtime uses a parser that implements the XML Pull API.

JiBX uses the XML Pull parsing technique. Instead of the parser calling methods in the handler to report document parts, one calls the parser to get each component in turn, easing the maintenance of the document state.

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.