Closed GoogleCodeExporter closed 9 years ago
Ah, I think I understand -- the issue is that you can't introduce an Interface,
only another class (and then the proxy inherits any interfaces implemented on
that class).
It would be nice if I could introduce an iterface this way, and allow the
method interceptor to handle the implementation, essentially providing a
shorthand approach, rather than hooking the ClassBuilder.
Original comment by martypit...@gtempaccount.com
on 18 Jun 2011 at 6:12
hey there,
yep, you are correct, introduce() is actually a merge of an existing class with
the generated proxy.
As for your ideas about using the method interceptor, this might be interesting
indeed. What do you think would be the most intuitive approach for this?
Would a developer use the introduce() method for both situations? Or should I
just add a proxyInterface() method that automatically adds the interfaces
methods to the generated proxy? I guess the latter would be clearer, right?
cheers,
Roland
Original comment by ihatelivelyids
on 19 Jun 2011 at 8:51
I think that if you're introducing an interface, the developer should be
responsible for also providing the interceptor responsible for the methods.
Therefore, as the signatures would be different, I guess a seperate method:
function
introduceInterface(interface:Class,interceptor:IMethodInvocationInterceptor):voi
d;
Thanks for the feedback - much appreciated.
Cheers,
Marty
Original comment by martypit...@gtempaccount.com
on 20 Jun 2011 at 11:11
Ok,
I've added a implementInterface() method to the IClassProxyInfo. I decided not
to use 'introcudeInterface' since this would be even more confusing with the
already existing introduce() method.
implementInterface() will dynamically add all of the members of the interface
to the proxy class. It is up to the existing IMethodInvocationInterceptor(s) to
figure out where the intercepted methods belong to. The IMethodInvocation
instance holds enough contextual information for this I'd say.
Thanks for suggesting this feature!
cheers,
Roland
Original comment by ihatelivelyids
on 3 Sep 2011 at 8:47
Ow, the changes are currently only available in the trunk.
I'm having issues with our Nexus server so I can't make a release for the
moment, once this is sorted I'll release RC6 of the bytecode library.
cheers,
ROland
Original comment by ihatelivelyids
on 3 Sep 2011 at 8:48
Original issue reported on code.google.com by
martypit...@gtempaccount.com
on 18 Jun 2011 at 6:01