Re: [Objectbridge-jdo-dev] ojb suitable for jdo implementation
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2002-05-12 15:48:53
|
Hi Sebastian, Sebastian Kanthak wrote: > Hi, > > I'm strongly interested in (working on) open-source jdo implementations and > noticed your project. I took a first look at ojb and wondered about the > following problem: > > If I understood the source code correctly, ojb uses reflection to read/write > member variables of persistence capable classes. OJB provides an Interface PersistentField to encapsulate the field access. Currently we provide two implementations, one based on reflection, one based on Javabeans property access. The used implementation is configured in OJB.properties. > On the other hand, jdo uses > an explicit interface (PersistenceCapable) implemented automatically by the > enhancer. My question is: Do you want to keep the "reflection-based" approach > for your jdo implementation? No we will stick 100% to the JDO spec! > This would probably lead to problems when > working with enhanced classes, as they expect a state-manager providing them > their fields via the the methods defined in the PersistenceCapable (and > StateManager) interfaces. However, the spec requires binary compatibility > between jdo implementations, e.g. it has to work with classes enhanced by the > reference enhancer. > That's why we have to stick to the spec! Otherwise we won't be JDO compliant and won't be able to work with classes enhanced by different tools. > Of course there are other tradeoffs between the reflection-based approach and > an enhancer-based approach: > > - Reflection should be somewhat slower than enhanced classes Right its also slower than the Javabeans compliant approach. > - Enhancement is another step in the build process and can make debugging > difficult > - Enhancement does not require Proxy-generated classes as stubs to load > objects from the datastore on-demand. Yes, all those infrastructure-stuff can be hidden by the enhancement process. > > So, to summarize my question: Do you want to keep the reflectio-based > approach No! (In fact OJB is already open in this respect) > or is a solution possible, where data read from the data store is > passed to a StateManager instead of directly into the PersistenceCapable > instance? > Sure! cu, Thomas > ciao Sebastian > > |