db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: PersistentField Problems
Date Thu, 03 Jul 2003 17:21:01 GMT
Hi Brian,

Brian McCallister wrote:
> Are there any plans or thoughts on changing the PersistentField 
> mechanism to be on a per-class basis?

No plans so far.
The only planned thing is a refactoring to clean up the inheritance 
hierachy in the fieldaccess package.

> 
> I ask because I need to access some classes (and different fields within 
> those classes, but am willing to forego that one and make people do it 
> all one way or the other on a per-class basis at least) using the 
> default (private field), and some via BeanUtils access to DynaBean 
> properties (which isn't possible right now under any of the 
> PersistentField implementations) 
There is a DynaBean implementation already!

> and yet more under standard JavaBean 
> accessors.
> 
> I am thinking of writing a staged PersistentField implementation that 
> attempts to use default access, then goes to a BeanUtils based retrieval 
> (which will grab JavaBeans properties or DynaBean properties). This 
> feels a lot like a hack (especially if you cache the results of what 
> worked for what class type to avoid the switch on the exception that 
> will get thrown (ick)) because what it is really doing is tracking on a 
> per-class basis how it needs to get the properties. The "right" feeling 
> way to do it is to allow specification for the class instead of for the 
> entirety of OJB in the OJB.properties.

There have been no request for a class specific implementation so far.
I think making it pluggable at the global level is sufficient. The 
scenario you describe is not very common and using a staged 
implementation does'nt sound so bad for me.

On the other hand:
I want to clean up the fieldaccess package for a long time now.
I want to refactor the stuff to form a clean inheritance hierachy.
I don't want to reimplement each new feature (e.g. NestedFields) in each 
PersistentField class.

There should be only one place to change this kind of logic and to keep 
only the specific access strategies (reflection, property, dynabean ...) 
in the leaf classes.

may be your feature request can trigger some volunteer work on the whole 
package ?!

cheers,
Thomas

> -Brian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 


Mime
View raw message