Re: Creating a JavaVM with JNI & Re:JavaBridge
Re: Creating a JavaVM with JNI & Re:JavaBridge
- Subject: Re: Creating a JavaVM with JNI & Re:JavaBridge
- From: Byron Wright <email@hidden>
- Date: Sun, 6 Mar 2005 17:28:30 -0800
Hi Phil,
I recently came to a point in my application design where I needed to
make a similar decision. Using the Java Bridge seems really start
forward... at first. In my experience (I was using java classes to
access a relatively complicated webservices with complex objects etc.)
things got "out of hand" really quickly. I ran into all sorts of memory
related problems (mostly due to my lack of understanding of the
mechanices of the Java Bridge), bindings become difficult because I
couldn't use the getters the java classes the axis wsdl2java generated,
( was hoping to keep my object model in Java because that's where they
where created). I ended up building a framework on top of the carbon's
WebServicesCore which suited my needs really well.
I think the question is, what does Java provide you with that Cocoa
can't?If it's only a few library calls and If it's simple enough to
rewrite in Cocoa I would do that rather. Perhaps there is a Carbon or
even a C library out that could provide you with the same
functionality? There is a pretty big overhead your application will
have if you have to use the Java Bridge because it has to instantiate
the JVM also.
On Mar 6, 2005, at 12:27 AM, Phil wrote:
On Sat, 5 Mar 2005 20:13:45 -0600, James B. Tuley <email@hidden>
wrote:
Yeah but if you can't instantiate Java objects from Obj-C, it kind of
makes this statement pointless "The Java bridge lets you write code in
one language that can reference an object in the other language. Java
objects can thus coexist with Objective-C ones in either language
environment"
Also, instantiating Java objects in Obj-C is shockingly easy compared
to the other way around.
The issue I face in my app (currently in the design-thing so I can
play around with this for a while), is that I need to instantiate Java
in Obj-C (nothing but a few library calls really).
I can either go with JNI (which many people seem to be pushing me
towards), and essentially build my own version of the Java Bridge so I
don't have to mess around with C calls all over the place. I
personally can't see the advantage of this - other than, being able to
see that I'm not using a potentially legacy (but technically
liberating) technology.
Or I can use the bridge, which would save me a heap of time and allow
me to easily push through many existing Foundation objects without
having to write my own wrappers to jstrings and jobects. The downside
being that I get a slower load time and using potentially legacy tech.
DTS told me.
::hands up in there air::
Would they care to share this with their developers who use this stuff?
Either way, I don't see them removing it anytime soon (otherwise, I
wouldn't think Cocoa-Java support in Xcode would've made it), they've
left it in long enough, and promoted it for long enough to create
developers that use it (in one way or another).
-Phil
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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