db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Anthony <charles.anth...@hpdsoftware.com>
Subject RE: OJB Proxies
Date Mon, 20 Sep 2004 13:22:37 GMT
Thanks for the comments, Brian.

> From: Brian McCallister [mailto:mccallister@forthillcompany.com]
> Sent: 20 September 2004 13:45 
> On Sep 16, 2004, at 4:09 AM, Charles Anthony wrote:
> <lots-of-cool-cglib-stuff />
> Not sure what was going on with everything being a proxy =/ Possibly 
> cache related?

Bum. This was the stop-this-experimentation-and-get-on-with-some-real-work
flag for me. 
It could be cache related (maybe the proxy is being put into the cache as
opposed to the materialized object).
> Anyway, in terms of mixing and matching bytecode proxies and dynamix 
> proxies, an excellent resource to look at is DynAOP ( 
> http://dynaop.dev.java.net ) which does exactly that -- using CGLIB2 
> and dynamic proxies where appropriate. If we didn't need field 
> interception I would argue for using dynaop for something like this 
> instead of going straight to CGLIB.

As is typical, though, I'm afraid I'm fairly sure I do need field
interception. Lots of other services in our app use field-level-reflection
to get values. (An example : all our fk ids are protected fields, but not
properties. Every now and then, we want to get at the fk directly to pop
into a query - we use a reflection - via a ReflectHelper class - to do

> Now, on bytecode munging, and benefits therein:
> I would strongly recommend making the bytecode munging technique 
> externalizable and have OJB only rely on a set of interface specs. 

Makes sense.

> For proxy generation, I would definitely go with the OJBProxy type 
> deal. Is IndrectionHandler an implemented interface, or the callback 
> the proxy uses ?

Simply the callback the proxy uses : basically the CGLib generated class
intercepts the methods, and head's them on to the indirection handler. 

> Regardless, the proxy factory should be pluggable and a  reasonable
default would be to ask the 
> fd.getObjectType().isInterface()  to switch between a dynamic proxy and a
cglib proxy. 
> Definitely provide > the facility to switch proxy factories to a non-cglib
based  one though 
> -- I'll have to use it ;-)

Indeed. Can I take it from your comments that the general idea is worthy of
being pursued ?

As seems to be typical for me at the moment[1], I suspect this bytecode
proxies project will have to go on the backburner for a while.

Still, it's all hopefully good fodder for the future, and maybe it'll spark
some ideas for others too.



[1] A big client is aiming to go live with our system, we're doing a vital
benchmark for another big project sponsor.

HPD Software Ltd. - Helping Business Finance Business
Email terms and conditions: www.hpdsoftware.com/disclaimer 

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

View raw message