Object/relational (O/R) mapping, a tremendous pain point for Java developers, is very important for JDO's acceptance among the general programming public. In fact, O/R mapping currently is the most popular use for JDO. In JDO 2.0, the specification team identified two main goals for JDO implementations that map objects to a relational database:
- A standard metadata form for representing class mappings to relational databases
- A standard runtime behavior for such classes
Because of its independence from any type of back-end data store, JDO 1.0 left O/R mapping to each vendor. However, the latest JDO spec will standardize the metadata and the runtime behavior to provide increased portability and reduced risk for organizations that use JDO for O/R mapping.
For those already using JDO implementations for this type of mapping, JDO 2.0 doesn't require any major change in functionality, although some of the specific metadata will change. Most vendors likely will provide a conversion tool to ease the burden of these changes on their customers.
The JDO 1.0 standard requires all classes to be concrete. JDO 2.0 includes two new features that expand the scope of JDO persistent types to include interfaces:
- Querying on a persistent interface retrieves matching instances from all persistent classes that implement that interface.
- Users can create an all-interface data model for rapid prototyping and development. The JDO implementation will dynamically generate the necessary implementing classes and data members based on the interfaces' JavaBeans-style get and set methods.
These features can decrease development time and increase the level of abstraction available to JDO users. The robust handling of interfaces in queries and relations allows the use of complex, decoupled object models. Additionally, this effort opens the door to additional JDO implementation strategies, which grows the JDO community as a whole.