Feature
Exploring XML Schema Styles Using JAXB in Enterprise Applications
Choose the right XML Schema for your enterprise applications
Aug. 2, 2005 10:15 PM
Recommendations
Table 5 summarizes the assessment of quality attributes for the XML Schema and the generated class model based on the observations above. The use of a particular style will be based on requirements, skills of the developer, and development time constraints. However, in general, it can be observed that styles 2 and 4 seem to have the most assessments of High quality for both the XML Schema and the generated class model. Both of these styles have global complex types, which leads to a schema with highly flexible and reusable type specifications regardless of its element specifications. These two styles only differ in the scope of their element specifications, but based on needs, it may be desirable to use one style over the other. In general, based on this assessment, XML schemas should be defined with global type specifications. Styles 2 and 4 would be more appropriate for a formalized development environment with large XML Schemas, whereas styles 1 and 3 would be acceptable for small XML Schemas.
This approach of assessing the quality of an XML Schema and a generated class model, within the context of a tool such as JAXB, should provide value in determining which style to use.
Summary
This article has discussed the four styles that are possible based on the various combinations of scopes of complex type and element specifications. Taxonomy of quality attributes was presented, which is to be used for quality assessment of each of the four styles. An example business object model was used and represented in XML Schema form for each of the four styles. Finally, a recommendation was provided about when each XML Schema style should be used.
Resources
About Pushkar VarmaPushkar 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.