advertisement

Article:
  Mixing Java and Titanium: Part Three
Subject:   Why use "Cocoa Java"? Why not just plain old "Cocoa" or JDK 1.whatever and Swing?
Date:   2001-10-01 10:35:39
From:   smithkennedy
This is not meant to antagonize anybody. I am genuinely curious. I don't undestand why somebody would want to do this.


I had originally thought that the Java Cocoa bindings were created by Apple to allow Java or C++ programmers to more easily author native binary programs using the Cocoa framework, but allow them to leverage their familiarity with Java/C++ syntax. But from what I understood from talking with people at WWDC, a program written in Java using the Cocoa APIs does not compile into a native binary. Instead, it compiles into the usual Java bytecodes. The Cocoa Java bindings are simply JNI interfaces into the Cocoa framework. But this program has been written using a platform-dependent Java API, which means it isn't portable to other platforms. So you end up with a program that is tied to one platform, but doesn't execute natively on that platform.


I fail to see any advantage to writing a program in this way. If I am a skilled Java programmer, why would I not just write my program using whatever version of the JDK makes sense? I already know the APIs / frameworks available to me - why learn something new that isn't portable. And, alternatively, if I am willing and able to learn Objective-C, why wouldn't I learn the Cocoa framework using the language it was originally implemented in?


As I said, I am not trying to kick sand in anybody's eyes here. I just have never heard anybody demonstrate why this would be a good engineering decision. I come from a background of 5 years of Java development experience, and I have recently been trying to address what framework I should learn to develop UI on Mac OS X. Code portability is definitely important.


Thanks for any info.


1 to 4 of 4
  1. Why use "Cocoa Java"? Why not just plain old "Cocoa" or JDK 1.whatever and Swing?
    2003-12-05 01:07:30  maerics [View]

  2. Why use "Cocoa Java"? Why not just plain old "Cocoa" or JDK 1.whatever and Swing?
    2002-06-04 21:58:54  kastork [View]

  3. I use Swing.
    2001-10-04 12:27:36  gagganator [View]

  4. RE: Why use "Cocoa Java"? Why not just plain old "Cocoa" or JDK 1.whatever and Swing?
    2001-10-01 10:37:10  smithkennedy [View]

1 to 4 of 4