[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where are proxies instantiated?



Falko Braeutigam wrote:
> 
> On Wed, 11 Apr 2001, Joel Shellman wrote:
> > I've written up a dynamic proxy that I think will work. Now I just need
> > to find the place in the code to change so it will instantiate the dyn
> > proxy instead of the generated class. I'm going to look around for it
> > but if anyone is feeling generous and would like to point me in the
> > right direction, I'd appreciate it.
> 
> org.ozoneDB.core.AbstractObjectContainer.ozoneProxy()

Thank you. Well... bummer. I'm running into the same problem I ran into
last week when I was trying to use dynamic proxies. You can't create a
dynamic proxy that is an instanceof anything but an interface. The
problem is that the code wants an OzoneProxy back from that method--but
I can't return an OzoneProxy because it's a class instead of an
interface.

I just tried changing OzoneProxy into an interface and moving it's
implementation to OzoneProxyImpl. It appears that this would be a very
easy change as things mostly seemed to build even after just that simple
change.

Is this something that would be interesting? The big problem is it would
then break compatibility with current applications using Ozone.

To avoid that, I could make OzoneProxy implement IOzoneProxy (or
something like that) and then just anywhere in the code it expects an
OzoneProxy, to change it to an IOzoneProxy. This would not break
compatibility with existing programs.

Any thoughts?
-- 
Joel Shellman
KnOcean Interactive Corporation
http://www.knocean.com/