[232] in java-interest
Re: Native Methods Question
daemon@ATHENA.MIT.EDU (jim frost)
Thu Jun 8 09:30:13 1995
To: Kevin Collins <kevinc@hppcih58.fc.hp.com>
Cc: cmcmanis@scndprsn.Eng.Sun.COM, java-interest@java.Eng.Sun.COM,
chrisk@hppcih58.fc.hp.com, detlef@hppcih58.fc.hp.com
In-Reply-To: Your message of "Wed, 07 Jun 1995 11:28:15 EDT."
<9506071728.AA06226@hppcih58.fc.hp.com>
Date: Thu, 08 Jun 1995 09:11:08 -0400
From: jim frost <jimf@world.std.com>
|> Native code is NEVER dynamically downloaded and run and it is not portable.
|
|I was trying to figure out how this "miracle happens here" was occurring.
|Let me ask a few more questions along this line :
|
|1) "NEVER ..."
| How is native code called? Continuing with the File example, is the
| native method executed back on the server via some type of invocation
| from the client? I wish there was a picture of this in the documentation :)
|
| If it is not invoked on the server, is the implication that the code,
| and therefore the Java class, are only useful to browsers running on
| the same platform as the native code was compiled?
|
| If native code is not somehow portable, then why/when/where would
| I want to use native code?
It's executed on the client. You'd use native methods where
performance matters or when it's the only way to interact with
something else (eg providing an OS service class). They are of course
completely nonportable.
|If I wanted to encapsulate an existing C library what would you think
|about just creating a message-based interface to it and communicating
|with it via Java networking calls only? Is this a reasonable approach?
You're describing RPC, which will certainly work, but you'll probably
pay a performance price far greater than you would to simply use the
interpreter.
jim frost
jimf@world.std.com
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com