For some custom client-server-communication code in GWT, I'd like to dynamically implement a Java interface similar to the way it would be done with java.lang.reflect.Proxy. Since GWT doesn't include any reflection support and I am loathe to write a clunky Code Generator, I'm wondering if this could be done with JSNI and Overlay types.
I'm thinking along the following lines:
Has anybody attempted something similar? Are there reasons why this won't work on principle?
Thanks in advance.
What prevents you from doing the same thing in Java? Have a factory method that you pass some data to, and it returns an implementation of your interface. Since you say implementation is pretty trivial you would have a limited set of concrete classes.