YOUR FEEDBACK
Three RIA Platforms Compared: Adobe Flex, Google Web Toolkit, and OpenLaszlo
NN wrote: Yeah you are right GWT is poor man's Flex. After using GWT on two...
SOA World Conference
Virtualization Conference
$200 Savings Expire May 16, 2008... – Register Today!


2007 West
GOLD SPONSORS:
Active Endpoints
Your SOA Needs BPEL for Orchestration
BEA
Virtualized SOA: Adaptive Infrastructure for Demanding Applications
Nexaweb
Overcoming Bandwidth Challenges with Nexaweb
TIBCO
What is Service Virtualization?
SILVER SPONSORS:
WSO2
Using Web Services Technologies and FOSS Solutions
Click For 2007 East
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TODAY'S TOP SOA & WEBSERVICES LINKS


Exploring XML Schema Styles Using JAXB in Enterprise Applications
Choose the right XML Schema for your enterprise applications

Digg This!

Page 1 of 2   next page »

Code-generation tools are capable of significantly impacting productivity and are now an essential part of a developer's tool set. There are two categories of transformation tools: those whose output is used by software components, and those whose output is used by developers. With tools that generate output for developers, it becomes important to properly design the input to these tools so that the output is comprehensible and usable, and the input is maintainable by developers. Java Architecture for XML Binding (JAXB) is one such tool that takes an XML Schema file as input, and transforms this input into a Java class model that is usable directly by a developer. Since an essential part of any application is its information model, it becomes important to properly design the XML Schema so that the generated class model is comprehensible and usable, and the schema itself is maintainable and reusable.

This article explores various styles for designing XML Schemas and assesses each style in terms of certain quality attributes. Figure 1 shows how an information model is transformed to a class model using JAXB, and shows which qualities of the artifacts should be assessed based on a set of quality attributes.

There are four XML Schema styles based on various combinations of the global and local scope of elements and complex types. The styles are assessed by evaluating how the JAXB output satisfies comprehensibility and usability concerns, and how well the XML Schema satisfies modifiability and reusability concerns. The JAXB component's quality is not assessed since its implementation is based on a standard and there is little variability in its behavior; once a developer learns to use it, its model behavior is predictable.

The Design Context
When designing an XML-centric application, two concerns need to be addressed:

  1. Functional Concerns - How to represent an information model, i.e., a data model or a UML class model, in XML using XML Schema so that any subset of the information model can be produced and consumed in a flexible and extensible manner, and the information model can be correctly represented in XML.
  2. Quality Concerns - How to design an XML Schema that is maintainable and reusable, and allows processing by a tool (JAXB) so that the generated output from the tool is comprehensible and usable by a developer.
The Quality concerns are the primary focus of this article, since the design of the XML Schema will be a significant contributing factor to how well quality concerns are satisfied. Figure 2 shows a design concern tree with the two main design concern paths and further subconcerns for each path. The functional concerns are primarily satisfied by the XML Schema specification, while the Quality concerns will be satisfied to varying degrees based on the XML-to-Java binding framework, and the design of the XML Schema used as input to the framework.

XML Schema Styles
XML Schema styles are based on various combinations of global and local scopes for XML Schema Element and Complex Type declarations. Table 1 shows the four styles.

Why is one style chosen over another? Normally, a developer may choose to use Style 1 <L, L> over Style 3 <L, G> simply due to level of knowledge and experience, lack of time, or simply a preference. However, each style will have different degrees of influence on the qualities of the XML Schema, and the resulting generated Java code. For example, maintainability of an XML Schema file will be significantly impacted based on what style is used, and comprehensibility of the resulting Java code will be sensitive to each style as well.

Quality Attributes for Evaluating XML Schema Styles
Figure 3 shows a tree view of quality attributes that will be used to assess the quality of the XML Schema and the generated class model for each XML schema style. This list is not comprehensive, but is only meant to be a starting point for introducing quality assessment of XML Schema styles in the context of code generation tools. Each quality attribute will be assessed simply as High or Low, so as not to get overly complex. Table 2 shows what High or Low means for each quality attribute.

When creating an XML Schema, element specifications and type specifications are normally defined separately since type specifications represent pure business domain entities, and element specifications represent roles of their underlying type.

Example
First, a business object model (BOM) is described that shows the key business entities and relationships. Then the BOM is specified in XML Schema using each of the four styles discussed earlier. Each XML Schema is then input into JAXB to generate a class model, whose UML representation is presented as well. Each style's XML Schema and generated class model are assessed using the quality attributes.

Business Object Model
Figure 4 shows an example business object model. This model shows simple aggregate associations, e.g., Customer to Order, and multiple associations between two entities with different roles, e.g., Customer to Address. In order to understand the dynamics among the XML Schema, JAXB transformation, and generated class model, the model was kept simple, hence it leaves out self-relationships and inheritance.

Listings 1 to 4 and Figures 5 to 8 show a representation of the object model in XML Schema using the four styles, and their corresponding generated JAXB class models, respectively.

Assessing the Styles
Based on the example analyzed above, quality assessment of each style is summarized in Tables 3 and 4. For the XML Schema quality, styles 2 and 4, the ones with global complex types, offer the highest modifiability and reusability, and style 3 and 4, the ones with global complex types, have the highest flexibility. For the generated class model, style 2 has the highest simplicity, while any style with at least a global element or complex types has a high structural affinity.


Page 1 of 2   next page »

About Pushkar Varma
Pushkar Varma is an IT architect with IBM Global Services whose interests include application architectures, architecture assessment methods, Web application development using Web services and J2EE, and rich clients using Eclipse.

XML Journal News Desk wrote: Exploring XML Schema Styles Using JAXB in Enterprise Applications. Code-generation tools are capable of significantly impacting productivity and are now an essential part of a developer's tool set. There are two categories of transformation tools: those whose output is used by software components, and those whose output is used by developers. With tools that generate output for developers, it becomes important to properly design the input to these tools so that the output is comprehensible and usable, and the input is maintainable by developers. Java Architecture for XML Binding (JAXB) is one such tool that takes an XML Schema file as input, and transforms this input into a Java class model that is usable directly by a developer.
read & respond »
XML JOURNAL LATEST STORIES . . .
3rd International Virtualization Conference & Expo: Themes & Topics
From Application Virtualization to Xen, a round-up of the virtualization themes & topics being discussed in NYC June 23-24, 2008 by the world-class speaker faculty at the 3rd International Virtualization Conference & Expo being held by SYS-CON Events in The Roosevelt Hotel, in midtown
Red Hat Named "Platinum Sponsor" of Virtualization Conference & Expo
Red Hat is a trusted open source provider. Red Hat offers enterprise customers a long-term plan for building infrastructures on the quality and innovation of open source. Combining open source operating system platform, Red Hat Enterprise Linux, together with applications, management
JustSystems Contributes Key XBRL Rendering Technology to Financial Community
JustSystems announced that it is contributing intellectual property rights for its invention of eXtensible Business Reporting Language (XBRL) rendering technologies to XBRL International, the standards body responsible for the oversight of the XBRL specification. The invention, known a
JustSystems Launches Campaign for XBRL Success
JustSystems announced its campaign to help organizations adopt XBRL (eXtensible Business Reporting Language), the XML-based standard for communicating financial and business information. In related news, JustSystems also announced that it has contributed intellectual property rights of
Virtualization Meets DaaS - Desktop-as-a-Service
After a $1.5 million angel round, Desktone, which was started in 2006 by Eric Pulier, who also started SOA Software, US Interactive and IVT, picked up $17 million in first-round funding about a year ago from Highland Capital Partners, SoftBank Capital, Citrix Systems and the China-base
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS


ADS BY GOOGLE
BREAKING XML NEWS
RCG IT Addresses BI and SOA Convergence and Business Architecture at TDWI World Conference in Chicago
RCG Information Technology, Inc. (http://www.rcgit.com/) will participate in The Data Wareho