-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MethodWrapper: Get rid of reflection and dynamic code #2
Comments
One scenario, where this is not easy is marshaling of interface implementation, in case when you don't have exactly one matching class for the proxy. You have to create proxy which implements superset of the interfaces of the proxied type. And that's dynamic problem at runtime. We could discuss how important this scenario is, and maybe throw it under the bus. |
I'm sorry, but I don't understand the problem you are describing. Could you provide the example of Java code that will require dynamically generated proxy? |
We generated wrappers/proxies for |
What does "he sends it" to C# mean in this case? I'm maybe completely off, because up this point I've only concidered C# -> Java direction of invocation, but doesn't sending something to C# mean returning it from Java method for which we have C# proxy? Because in that case we would know the interface type statically by the return type of the method. |
Yes it could be on return from C#->Java call The signature would be You are right that
|
Thanks, now I undestand. My implemenation is miles away from considering this. |
Alternative to This breaks reference equals on the proxy instances. I don't rememeber anymore if jni4net creates proxy instances per call of if I have some cache for it. |
Yeah this is tough. Given that the proxygen knows nothing about the superset classes, for the time-being I cannot think of anything better than reflection and runtime magic. On the other hand though, I am not quite sure if this type of usage is in the scope of jni4net, meaning that proxy generation seems to be more like a step in the compilation process and ideally should be able to know everything about every used type. However, it's too early to have well-educated opinion on this. |
Rewrite MethodWrapper in a way to support build time generated code instead of dynamic code.
#1 (comment)
The text was updated successfully, but these errors were encountered: