Re: Scripting engine - Java 6



On Tue, 31 Jul 2007 07:36:05 -0000, debasish
<ghosh.debasish@xxxxxxxxx> wrote, quoted or indirectly quoted someone
who said :

b) In cases when I return a Javascript array from my script code, what
I get back in Java is sun.org.mozilla.javascript.internal.NativeArray,
which is probably a wrapper for org.mozilla.javascript.NativeArray. Is
it the common practice to handle these sun.org datatypes within my
Java program ? Or is there a way I can get back the actual mozilla
NativeArray type ?

What Sun is constantly trying to do with JCE, JDBC and now the
scripting is to make pluggable interfaces where various
implementations can replace Sun code with minimal fuss in the
applications. I laud them for this. Very early on I argued that
providing pluggable interfaces would be far more useful to the Java
community than providing polished implementations. I asked them to
create standard interfaces for every conceivable purpose, with a
reference implementation as a secondary concern, and a decent
implementation as a tertiary concern. I doubt it is because of my
request, but they have done what I wanted in spades. It is so rare a
corporation does what I wanted it to.

Sun are trying to mask the squirrelly differences between
implementation so you can swap implementors in a heartbeat. You are
trying to defeat them. You are better off ignoring Java's generifying
layer and using Mozilla Rhino directly.

see http://mindprod.com/jgloss/rhino.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.



Relevant Pages