|
|
YOUR FEEDBACK
SOA World Conference
Virtualization Conference $200 Savings Expire May 16, 2008... – Register Today! Did you read today's front page stories & breaking news?
SYS-CON.TV |
TODAY'S TOP SOA & WEBSERVICES LINKS Feature
Exploring XML Schema Styles Using JAXB in Enterprise Applications
Choose the right XML Schema for your enterprise applications
By: Pushkar Varma
Aug. 2, 2005 10:15 PM
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.
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
XML Schema 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 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
Business Object Model 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 Page 1 of 2 next page »
XML JOURNAL LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING XML NEWS
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||