Re: Are cocoa frameworks language neutral?
Re: Are cocoa frameworks language neutral?
- Subject: Re: Are cocoa frameworks language neutral?
- From: Matt Lehrian <email@hidden>
- Date: Mon, 13 Oct 2003 00:06:07 -0400
I've written some applications that use the JavaBridge, and while the
documentation is sparse, basic interoperability is pretty simple. I
wrote an eCommerce engine that used JBoss/Tomcat/mySQL (EJB/JSP) as the
web interface for people to purchase and register software. Then I
wrote a couple tools in Cocoa to view and manage the data in the
database via EJB. I even wrote a utility to parse my remote EJB
interface and dynamically create the necessary Objective C headers.
Pretty sweet, actually, because I could run the whole backend on pretty
much anything (Mac OS X, Linux, Windows, etc...) and have nice
management tools on Mac OS X that use the same public interfaces to the
database as the web application.
I eventually ran out of documentation when I started to look for ways
to automatically bridge the "less-standard" objects, like NSData <->
java.util.Calendar. I found references to something called bridget and
some Project Builder project templates, but I couldn't find instances
of them anywhere.
But, for the basics, this is definitely the way to go. Of course,
there are some things to be aware of, mostly memory management stuff,
but that seems to be pretty well documented.
Good luck!
Matt
On Oct 12, 2003, at 10:25 PM, publiclook wrote:
JNI is generally NOT needed to interface Objective-C and Java. There
is a very nice and reasonably high performance Java bridge available
as a standard component and everything is pretty much automatic.
I recommend doing any and all of Apple's Cocoa-Java examples as well
as using available resources on the net. Search
http://cocoa.mamasam.com for "Cocoa AND Java". There are not that
many people using Cocoa and Java together, but some are and it does
work.
On Sunday, October 12, 2003, at 08:18 PM, Jeff Galyan wrote:
You would still need to use JNI to access ObjC from Java and
vice-versa, so
in that sense, Cocoa is not language-neutral. It's not like MS .NET
CLR,
where pretty much any language can access bits written in any other
language
without any special work on the part of the programmer (and without
any
penalty), which is what I sense the question is leaning towards. I
remember
reading some time back about some "Cocoa-Java Bridge" (or something
like
that) that was supposed to let ObjC and Java interact seamlessly, but
I
don't know if that ever materialized or, if it did, if it's faster or
slower
than JNI. I haven't seen any talk about that since before Mac OS X
10.0
release.
So, "impedance mismatch" has a dual meaning here: on the one hand,
there is
a performance hit for using JNI to bridge between native and Java
code (for
calls between), and on the other hand, Java code tends to run a bit
slower
than native code anyway.
"might not have the best feel" most likely refers to that performance
hit.
It's faster and more responsive for the user if you leave out the Java
pieces.
Best,
Jeff
On 10/12/03 4:27 PM, "Vineet Bhatia" <email@hidden> wrote:
What do you mean by might not have the best "feel"?
And impedance mismatch?
Have you worked on any projects which have the framework written to
access
business tier in java and all the UI components in Objective-C?
Are there any examples available online?
- vineet
From: Chris Hanson <email@hidden>
Date: Sun, 12 Oct 2003 17:40:03 -0500
To: email@hidden
Subject: Re: Are cocoa frameworks language neutral?
On Saturday, October 11, 2003, at 09:52 AM, Vineet Bhatia wrote:
If I write a cocoa framework in Java would I be able to use it from
Objective-C?
I think so. However, it might not have the best "feel" in
Objective-C
because of the impedance mismatch between the languages.
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Mac OS X Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.