16.10.2015 Views

Getting Startedwith pureQuery

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 15 – <strong>pureQuery</strong> and pureXML 293<br />

15.5 Summary<br />

This chapter proposed three approaches for handling pureXML data in <strong>pureQuery</strong><br />

applications. These approaches highlight the usage of different layers of an application to<br />

do the required step of XMLJava mapping. There are certainly other alternative<br />

approaches, and the ones listed can be combined in order to provide customized solutions.<br />

Each one of the approaches has it advantages and disadvantages that you should<br />

consider when developing your <strong>pureQuery</strong> application that uses pureXML data:<br />

• Giving control to the SQL layer<br />

o<br />

o<br />

Pros: it takes advantage of <strong>pureQuery</strong> relational mapping facilities.<br />

Reduced I/O, as only required info flows from database to application.<br />

Cons: requirement changes manifest in updates to both the SQL/XML<br />

statement and the bean. SQL/XML statement can become too complex<br />

depending on the amount of information fetched from XML data.<br />

• Giving control to the data access API<br />

o<br />

o<br />

Pros: Application and SQL layer are oblivious to schema changes. Tooling<br />

streamlines adoption of new schema or change in requirements.<br />

Cons: beans hierarchy can become overly complex when mapping from<br />

large XSD schemas. Increased I/O, as the whole document is fetched from<br />

database into data access layer.<br />

• Giving control to the application layer<br />

o<br />

o<br />

Pros: schema and requirement changes are oblivious to data access API<br />

and SQL layer. Flexibility when multiple requirements coexist.<br />

Cons: mapping complex to implement. Increased I/O, as full document<br />

contents are sent from database to application and back.<br />

This chapter is a shorter version of the IBM developerWorks article “Handling pureXML<br />

data in Java applications with <strong>pureQuery</strong>”, available at:<br />

http://www.ibm.com/developerworks/data/library/techarticle/dm-0901rodrigues/index.html

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!