Java Data Objects (JDO)

The JDO Enhancement Process

Gopalan Suresh Raj

 

 

In order for a Java class to be made persistent by a JDO implementation, it must be modified such that it implements a specified interface called the PersistenceCapable Interface. JDO Enhancement is the process through which this modification is achieved. There are at least two ways that this can be done:

Source-Code Enhancement

In this type of JDO Enhancement, the source code of the user's class is modified by the JDO vendor's tool to include the PersistenceCapable interface and its hooks. This is only possible if access to the user's source code is possible. This gives users the ability to see what was done to their source code. Additionally, this also provides code-auditors the ability to certify code since all the sources and their JDO modifications are available to them to see and certify. Mature implementations like hywy's Productivity Environment for JavaTM (PE:JTM) provide Source-Code Enhancement.  

Byte-Code Enhancement

A second approach is called 'byte code enhancement'. In this, the JDO vendor's tool modifies the byte codes of compiled classes so that the PersistenceCapable interface is supported. This does not require access to user's source code, but involves adding byte-code to the user's implementation. A Severe Disadvantage of 'byte code enhancement' is that users cannot see what modifications were made to their classes to add JDO interface hooks into their code. In implementations that provide 'byte code enhancement', the JDO Enhancement Process becomes a complete black-box that users will have to learn to trust. They will have to have faith in their vendor implementations to do the right thing for them since they have absolutely no control or knowledge of how their code has been modified.
 

Advantages of Source-Code Enhancement over Byte-Code Enhancement

A lot of people have expressed severe objections to byte code enhancement. They don't like things being done to their code which they can't see in the source. However, the JDO specification itself does not prescribe how the modifications are to be made, only the contract that is to be supported. JDO implementations that provide Source-Code Enhancement however, address these concerns effectively.
 

click here to go to
My JDO HomePage...

click here to go to
My Advanced Java Tutorial Page...

About the Author...
Gopalan Suresh Raj is a Software Architect, Developer and an active Author. He has co-authored a number of books including "Professional JMS", "Enterprise Java Computing-Applications and Architecture" and "The Awesome Power of JavaBeans". His expertise spans enterprise component architectures and distributed object computing. Visit him at his Web Cornucopia© site (https://gsraj.tripod.com/) or mail him at gopalan@gmx.net.

Go to the Component Engineering Cornucopia page

This site was developed and is maintained by Gopalan Suresh Raj

This page has been visited times since February 26,2002.

Last Updated : Feb 26, 2002

If you have any questions, comments, or problems regarding this site, please write to me I would love to hear from you.


Copyright (c) 1997-2002, Gopalan Suresh Raj - All rights reserved. Terms of use.

All products and companies mentioned at this site are trademarks of their respective owners.