Re: playing swf file
Re: playing swf file
- Subject: Re: playing swf file
- From: Scott Ellsworth <email@hidden>
- Date: Tue, 21 Mar 2006 11:14:40 -0800
On Mar 17, 2006, at 6:45 AM, Gurmit Teotia wrote:
Please suggest me which approach I should use:- JNI or Cocoa-Java
Bridge?
I would strongly recommend using JNI for what you have proposed in
preference to the Cocoa-java bridge. JNI is the standard way to
contact a Java service from C, and vice versa. Thus, if you ever
port the code to a different platform, you can write a different OS-
level shim or library that does the C-level work, and can then call
it happily from Java as needed.
I dearly love Java as a language, even though it has its problems.
That said, the Cocoa-Java bridge is not the right way to go for
access to underlying Cocoa goodies. In my ideal world, Cocoa
services would be exposed through carefully thought out Java APIs.
Failing that, Cocoa/CF services would be exposed automatically by a
supported and well maintained performant tool at Apple's end. Since
neither is happening, the bridge is not the best way to go, IMO.
There is a cost to JNI - a pile of microseconds per call - so it is
not the right way to go for a single arithmetic operation. It is a
decent way to go, though, for a database call, network access, or
multimegabyte disk write, as the small JNI overhead will be
completely swamped.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden