advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Download the code for this article
What has your experience with JDO been? What features would you like to see added in future releases? Tell us about it.
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 3/5 | Rate this item | 2 users have rated this item.
 

Java Data Objects (JDO): An Object-based Approach to Transparent Persistence

For persistence storages, JDO provides a better and more efficient approach to application development. 


advertisement

hese days almost every application requires some sort of data persistence, whether local, remote, or both. Developers traditionally have built applications with a specific data store and source in mind, using data store-specific APIs. This approach becomes troublesome and resource-intensive when trying to support and certify an application on numerous persistent data stores. Still, developers have had no choice but to learn, code, and test data source-specific APIs, despite the significant added overhead in the product lifecycle.



The JDO specification defines a set of Java APIs that exposes a consistent model to programmers interacting with disparate data sources.

For persistence storages like file systems, RDMSs, and object-oriented databases, Java Data Objects (JDO) provides a better and more efficient approach to application development. JDO provides developers with another layer of abstraction that encapsulates data store-specific details, letting application programmers concentrate on business logic rather than persistence storage intricacies. JDO provides a Java object interface to the data source, so developers perform data operations the same way they treat any other Java object. The result is faster application development (read quicker time to market) and fewer worries about persistent data storage.

JDO Overview
The two main goals of the JDO specification are to provide:

  • For application developers: A consistent Java-object-model-centric view of permanent data stores, whether local or networked.
  • For software vendors: Detailed contracts and clear declarations of roles and responsibilities for application servers and JDO implementation providers so that various data stores can be plugged seamlessly into their applications.
     
    Figure 1 | A typical JDO-based application scenario

    JDO addresses not only enterprise data, but also persistent data in general (even in embedded systems). In a two-tier environment, JDO hides the details of data storage, types, relationships, and retrieval. In the more complex managed multi-tier environment JDO also handles concurrency issues, transactions, scalability, security, and connection management.

    Figure 1 depicts a typical JDO-based application scenario.

    JDO relies on the J2EE Connector architecture (JCA) for EIS access and uses the Java Transaction API (JTA) for distributed transactions. A JDO instance is a persistence-capable (implements PersistenceCapable interface) class, each instance of which represents some form of persistent data. You can make a Java class persistence-capable by either explicitly implementing the PersistenceCapable interface or using a JDO enhancer during or after compile time. (A JDO enhancer is a byte code enhancer program that modifies the byte codes of Java class files to enable transparent loading and storing of the persistent instances' fields.) You can make almost any user-defined class PersistenceCapable; however, some system classes, such as Thread, Socket, and File, among others, can never be persistence capable.

    Instances of a persistence-capable class can be either transient or persistent. Java defines two concepts for determining whether two instances are the same instance (identity) or whether they represent the same data (equality). Java object identity is entirely managed by the Instances are identical if and only if they occupy the same storage location within the Java Virtual Machine (JVM). JDO extends these concepts to determine if two instances represent the same data store object. Hence, a JDO identity differs from that of a Java object identity.

  •   Next Page: The JDO Query Interface


    Page 1: IntroductionPage 3: JDO Query Example
    Page 2: The JDO Query Interface Page 4: JDO Query Example (cont'd)
    Please rate this item (5=best)
     1  2  3  4  5
    advertisement
    Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

    internet.commediabistro.comJusttechjobs.comGraphics.com

    Search:

    WebMediaBrands Corporate Info

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs