M
Michael N. Christoff
First, a definition of dynamic proxies:
A dynamic proxy class is a class that implements a list of interfaces
specified at runtime such that a method invocation through one of the
interfaces on an instance of the class will be encoded and dispatched to
another object through a uniform interface. Thus, a dynamic proxy class can
be used to create a type-safe proxy object for a list of interfaces without
requiring pre-generation of the proxy class, such as with compile-time
tools.
---
How would one use AOP (aspect oriented programming) to implement dynamic
proxies? The closest I have seen is by way of 'introductions', but don't
most frameworks require you to specify the interfaces you can implement in
an introduction at compile time? What if you wanted to implement an
interface loaded dynamically at runtime?
I'm more interested in how this is done theoretically, but specific
solutions (like a solution using jboss aop) would also be of help. I
presume AspectJ cannot do this at all since it uses a purely build-time
aspect weaver.
l8r, Mike N. Christoff
A dynamic proxy class is a class that implements a list of interfaces
specified at runtime such that a method invocation through one of the
interfaces on an instance of the class will be encoded and dispatched to
another object through a uniform interface. Thus, a dynamic proxy class can
be used to create a type-safe proxy object for a list of interfaces without
requiring pre-generation of the proxy class, such as with compile-time
tools.
---
How would one use AOP (aspect oriented programming) to implement dynamic
proxies? The closest I have seen is by way of 'introductions', but don't
most frameworks require you to specify the interfaces you can implement in
an introduction at compile time? What if you wanted to implement an
interface loaded dynamically at runtime?
I'm more interested in how this is done theoretically, but specific
solutions (like a solution using jboss aop) would also be of help. I
presume AspectJ cannot do this at all since it uses a purely build-time
aspect weaver.
l8r, Mike N. Christoff