Docs/examples for JSAdapter
Rick Bullotta
rick.bullotta at thingworx.com
Tue Oct 22 10:45:03 PDT 2013
Can't do that. There are a number of operations that occur inside of our wrappers that require pure Java.
-----Original Message-----
From: nashorn-dev-bounces at openjdk.java.net [mailto:nashorn-dev-bounces at openjdk.java.net] On Behalf Of Tal Liron
Sent: Tuesday, October 22, 2013 1:43 PM
To: nashorn-dev at openjdk.java.net
Subject: Re: Docs/examples for JSAdapter
Rick, have you considered writing a wrapper library in pure JavaScript over the harsher Java-written API? Users won't even have to know that Java is being called behind the scenes.
It's much more natural to write such things in JavaScript, and it would also be more portable to other JS engines (Rhino). I've done this quite a bit!
On 10/23/2013 12:58 AM, Rick Bullotta wrote:
> I totally agree on the benefit of calling Java directly. I just want to create a seamless DSL for my users.
>
> So subclassing JSObject is the only way it seems (e.g. an interface-based approach wouldn't work). What about a hybrid interface + annotation based approach? Annotate the class to tell it to dynalink, and have an interface that implements getMember, getSlot, etc...
>
> Is that possible?
>
More information about the nashorn-dev
mailing list