#1934 Dynamic Proxies?

SlimerDude Fri 29 Jun 2012

In Fantom, is it possible to create something akin to Java's Dynamic Proxy?

brian Fri 29 Jun 2012

Not exactly, typically I use -> for stuff like that.

But it would be pretty easy to wire up by just generating a bit of source code that implements the mixin you want, then calling sys::Env.compileScript to generate the mapping class.

SlimerDude Sat 30 Jun 2012

-> would only be useful when you know your object is a Proxy, typically you use proxies to silently replace the original object. e.g. substituting a mock.

sys::Env.compileScript certainly sounds enticing. Thanks!

Login or Signup to reply.