What if you could combine Cocoa (that easy-to-use extension to C that is the primary language used for development on the OS X platform) and Java (one of the most widely used languages on the Internet) to create an OS X native application that utilizes the power of Java’s libraries? Marcus Zarra does just that in this latest article in his series on Cocoa from the Java developer’s perspective.
Didn’t Apple anounce that they’re discontinuing development of the java-cocoa bridge so that no post Tiger Cocoa features will be supported?
If so, JIGS may be the answer. It’s a Java-*Step brige for GNUStep. Linking it to support Cocoa under OSX shouldn’t be too hard.
http://www.gnustep.it/jigs/
Discussed briefly here:
http://lists.gnu.org/archive/html/discuss-gnustep/2001-10/msg00200….
> Didn’t Apple anounce that they’re discontinuing development of the
> java-cocoa bridge so that no post Tiger Cocoa features will be
> supported?
Yep.
“Important: Cocoa-Java technology is only a learning tool. Applications targeted for release to customers must be developed using Objective-C to take advantage of all the programming interfaces available in Cocoa. Programming interfaces added to Cocoa in Mac OS X versions later than 10.4 will not be available to Cocoa-Java applications.”
(http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaObje…)
If Apple aren’t going to maintain and enhance the bridge then perhaps they ought to turn the bindings over to the open source community.
Otherwise it will stagnate. Even gnome has java bindings:
http://java-gnome.sourceforge.net/
You’d think Apple would open-source the bindings if they had any sense.
Some developers, foolish creatures that they are, might actually have taken them seriously and used them for significant work before the political stance about “only a learning tool” was spouted. I’m sure the community would be more than happy to support them (if Cocoa was accessible).
Quick comment:
“What if you could combine Cocoa (that easy-to-use extension to C that is the primary language used for development on the OS X platform)”
Cocoa is not a language, it is an API. Objective-C is the extension to C which is primary language to OS X development (though C is used a lot with Carbon).
I decided to do a team project at school in Cocoa-Java since the other team members felt more comfortable with Java than ObjC. It’s not that the Java bridge is broken, but if you come from an ObjC cocoa background, you’ll find yourself wondering what’s going on a lot of the time.
A few simple examples:
There’s no NSString object in Java, instead the bridge does the conversion from String to NSString for you. This is fine 98% of the time, but sometimes you want some method that’s specific to NSString, like say drawing it inside of a view. Now instead you need a 10 line hack that involves NSLayoutManager etc…
There are rarely the same number of constructors in Java as there are for its ObjC counterparts. I can create an NSTimer and have it ready to start firing in 1 line of ObjC, but it takes me a few in Java cause I need to manually go and add it to the NSRunLoop.
These aren’t big things, and when you read the documentation properly, you can get around them. But I can’t wait to go back to plain old ObjC and start being productive in Cocoa again.
just a question (semi OT):
if i want to write a library that needs to be developed in a object oriented way, and also has to be easily bindable to another languages, is objective-c a good option? or have i to make my own verbose system like gobject? there is an automatic obj-c to plain c converter?
i guess it must be easy because any method in a obj-c object is invoked by one only function obj_message_send, and this is the only thing that has to binded by foreign languages…(well and to write again the objects using this function for dispatching)