db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leandro Rodrigo Saad Cruz <lean...@ibnetwork.com.br>
Subject Re: PersistentFields per class descriptors. was [RFC] Using java.lang.reflect.Proxy
Date Mon, 15 Mar 2004 14:55:47 GMT
On Mon, 2004-03-15 at 11:39, Thomas Dudziak wrote:
> 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. 

No. We can check if we are dealing with a proxy object using
Proxy.isProxyClass.


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

You can't change the way your proxies are created ?

> 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
-- 
Leandro Rodrigo Saad Cruz
InterBusiness Tecnologia e Servi├žos
IB    - www.ibnetwork.com.br
DB    - www.digitalbrand.com.br
OJB   - db.apache.org/ojb
XINGU - xingu.sf.net


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