Binary Compatibility

The standard enhancement interface defined by the JDO reference-enhancement contract provides binary compatibility among all enhancers and runtime environments. It requires that:

  • A class enhanced by the reference enhancer is usable with any JDO-compliant runtime environment.

  • A class enhanced by a JDO-compliant vendor’s enhancer is usable by the reference implementation’s runtime environment.

  • A class enhanced by a JDO-compliant vendor’s enhancer is usable by any other JDO-compliant runtime environment.

Furthermore, an enhanced class file can be shared concurrently in a JVM among several coresident JDO implementations.

An implementation’s runtime environment can determine whether a class was enhanced by its own enhancer. If it has, the implementation’s runtime environment can use any implementation-specific enhancements that were placed in the class file. Otherwise, it must use the standard reference-enhancement interface contract. Table 6-1 shows which enhancement interface a JDO runtime environment will use, based on the enhancer used to enhance the class.

Table 6-1. Enhancement interfaces used

Enhancer used

Reference runtime

Vendor A runtime

Vendor B runtime

Reference enhancer

Reference enhancement

Reference enhancement

Reference enhancement

Vendor A enhancer

Reference enhancement

Vendor A enhancement

Reference enhancement

Vendor B enhancer

Reference enhancement

Reference enhancement

Vendor B enhancement

You can distribute your classes in either their enhanced or unenhanced ...

Get Java Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.