JPOX
JPOX
JPOX  |  Ver 1.0  |  Ver 1.1  |  Ver 1.2  |  JDO  |  JPA  |  Project
Java Data Objects
Why JDO ?

The majority of applications need to persist (or store) data during their lifecycle. There are many ways of doing this with an application written in Java.

You can handle the persistence (and retrieval) of data yourself using JDBC. With JDBC, you have the burden of having to write the persistence layer yourself. This gives much control, but also creates significant work, both in writing the code but also in testing and maintenance.

You could also use J2EE, and persist data using Entity Beans. With J2EE you hand off the persistence of your objects to the EJB part of the J2EE server. This simplifies things, but places a major restriction on your code in that you have to write your objects as Entity Beans. In addition J2EE adds layers that are not necessarily required for your application.

You can use a proprietary or non-standards compliant persistence framework like TopLink, or Hibernate and persist your plain old Java objects. You will, however, be tied in to their API and be unable to easily move your system to an alternative implementation.

Alternatively you can use JDO, a standardised persistence interface. With JDO you can take your plain old Java objects and just persist them as they are. It is totally transparent and very little work is required by the developer.

To give a guide, here are a few important consideration points when choosing a persistence layer for your application.

FeatureJDBCCustom O/R (1)EJB (2)JDO
Standards-Driven and PortableYesNoYesYes
Choice of datastoresNoYesYesYes
Simple Java objectsYesYesNoYes
Out of box implementation (3)NoYesNoYes
Usable in stand-alone applicationYesYesNoYes
Usable in J2EE environmentYesYesYesYes
Simple to unit testYesYesNoYes
Dynamic queriesYes (4)YesNoYes
Primary Key generationYes (4)YesNo (5)Yes
Supports inherited objectsYes (4)YesNo (5)Yes
Automatic Creation of schema (top-down)NoYesNo (5)Yes
Supports existing schema (bottom-up)YesYesYesYes
  1. refers to products such as Hibernate, TopLink which follow no standard.
  2. refers to entity beans for EJB 2.*
  3. refers to whether it is necessary to write the persistence yourself (e.g as with JDBC) or whether you can just persist by simple calls.
  4. requires the developer to write this layer.
  5. some advanced EJB containers like Bea Weblogic and IBM Websphere provide support for primary key generation, inherited objects and database schema creation as well.