db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Dudziak <to...@first.gmd.de>
Subject Re: PersistentFields per class descriptors. was [RFC] Using java.lang.reflect.Proxy
Date Mon, 15 Mar 2004 14:39:47 GMT
On Mon, 15 Mar 2004, Leandro Rodrigo Saad Cruz wrote:

> I agree with you. however I think we could improve the way obj looks up
> class-descriptors for DynamicProxy objects.
> 
> DescriptorRepository.discoverDescriptor(Class clazz) calls
> obj.getClass().getInterfaces() and loops through the interface array
> searching for a class-desc for each interface.
> Couldn't we improve that using something like this
> 
> Class classOfProxy = ((DynamicProxy)proxy).getClassOfProxy().
> 
> then, proxy objects would have to implement DynamicProxy interface.

That wouldn't be good as this would require all non-ojb proxies to
implement an (probably empty) interface. I for one have an application
where I have no control whatsoever about the proxying stuff so that
wouldn't work for me at all.
If the class returned by the proxy is stable (i.e. always the same class
object) which is likely, then the lookup happens only once anyway as the
class descriptor is cached.

Tom


---------------------------------------------------------------------
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