Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 5117 days ago | link | parent

So Groovy allows dynamic classes, not just interfaces? I'd like to do that in Jarc also. But I don't see how to do it without generating byte code.

Right, making new classes that extend classes (besides java.lang.Object) at runtime seems to require generating byte code. From http://download.oracle.com/javase/6/docs/technotes/guides/sc...:

Sun's implementation of JDK 6 is co-bundled with the Mozilla Rhino based JavaScript script engine. (...)

Rhino's JavaAdapter has been removed. JavaAdapter is the feature by which a Java class can be extended by JavaScript and Java interfaces may be implemented by JavaScript. This feature also requires a class generation library. We have replaced Rhino's JavaAdapter with Sun's implementation of the JavaAdapter. In Sun implementation, only a single Java interface may be implemented by a JavaScript object.

In other words, the Rhino distributed with JDK 6 provides no JavaAdapter functionality the Proxy class can't already achieve....

Congrats on the job.

Thanks much! XD