19-09-2012, 02:45 PM
JOXM: Java Object — XML Mapping
JOXM Java Object.pdf (Size: 138.5 KB / Downloads: 33)
Abstract
Java Object XML Mapping (JOXM) is a library that supports the automated persistence and querying of Java objects in a native XML database. The goal of this library is to provide a suitable alternative to standard object-relational mapping (ORM) tools, most notably Hibernate [3]. Unlike techniques such as XML-relational persistence, the storage mechanism provided by JOXM is transparent, allowing the developer to store, retrieve, and query typed Java objects as opposed to plain XML data.
Introduction
The rise of the internet has presented a new paradigm of data management that has yet to be satisfactorily addressed by current technology. In a large number of applications, semi-structured data comes over the internet in XML form. The applications parse it into Document Object Model (DOM) and, as necessary, convert DOM trees into internal data models, represented by host language object instances in main memory. Applications then use object-relational mapping (ORM) to serialize and persist the data in a relational database (see Figure 1). Traditionally, use of ORM technologies, such as Hibernate [3], allows software developers to assure persistent storage of important application data, without the need to incorporate database development into the application development process and without the associated costs.
Related Work
In this section, we will briefly discuss some of the prior attempts to perform XML persistence, as well as their strengths and weaknesses.
Hibernate. Hibernate [3] is one of the most popular ORM technologies for interacting with relational databases. Its popularity derives from its simplicity and abstraction over the interactions with the database. Hibernate relieves developers from writing SQL queries and needing to understand the details of converting data from an in-memory object model to the relational database model. Hibernate uses relational databases as its backend. For XML data, represented as Java object instances, Hibernate essentially uses shredding to persist them in the database. We believe that with large data collections, and with high degree of diversity (semi-structuredness) in the data
Implementation
The Java Object XML Mapping (JOXM) library augments the previously described methods of handling XML data in an application by creating an automated persistence layer to persist Java objects directly to a native XML database. JOXM is an implementation of object-XML mapping (OXM) for the Java language. JOXM’s goals are the following:
• Concise connection, persistence, and querying APIs;
• Connection to local databases through the XMLB API;
• Persistence API that abstracts XML data binding (marshaling and unmarshaling) and querying;
• Persistence of any Java object into a native XML database ;
• Support for issuing XPath queries, returning results as typed Java objects.
JOXM is a general purpose persistence library, with goals similar to those of Hibernate but placed in the context of native XML databases. JOXM provides a high-level abstraction of Java object persistence, with a ”hands-off” approach in implementing a persistence layer. Knowledge of the connection protocol, storage format, and XML querying (XPath/XQuery) syntax is not required. Application developers using JOXM to persist Java objects are simply making a few method calls which, in turn, save Java objects to an XML database.
Overview
The JOXM core provides the persistence, connection, and querying APIs that bind an application to the XML persistence model. Instead of the application needing to maintain intimate knowledge about the location or protocols for communicating with the database, it can communicate natively through the JOXM proxy. JOXM connects to a local/embedded database using the XMLB API, ensuring that the implementation of the XML database need only to adhere to the XMLB specification. This layer of abstraction allows the application to swap the back-end at any time. Besides support for connection management and transparent persistence, JOXM allows developers to issue XPath queries across its interface, with automated type conversion provided by default.
Conclusions and Future Work
XML is an extremely important and popular technology for storing documents on the web, and ORM is used to store object data within a relational framework. Despite some prior attempts, there has not yet been an effective way of performing Object-XML Mapping (OXM)–that is, until now. JOXM is a software package that facilitates Object-XML Mapping, and it addresses the needs of applications looking for a generic persistence layer supporting the XMLB API, XPath, and XQuery standards, and especially those in which the object model is hierarchically complex. It avoids the pitfalls of earlier OXM attempts, such as an inability to handle marshalling and native databases, in ways that are entirely transparent to the programmer.