Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How many of you are developing in cocoa java

How many of you are developing in cocoa java
Thread Tools
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
Aug 28, 2002, 03:51 AM
 
I am interested in Developing in Cocoa Java, as I see it as a usefull approach. I know Cocoa Java is frowned upon by many. I am also concerned that if Cocoa Java is not being used Apple may pull supports for Cocoa Java what little Apple has for it now.

So are you using Cocoa Java now or are you planning to develop in Cocoa Java?

If not why?
     
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
Aug 28, 2002, 04:03 AM
 
I am now, but just for fun. When I finish the little app I'm working on I'll post it on a website so I can share what I've learned.
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Aug 28, 2002, 04:26 AM
 
I don't believe Apple will pull support for the bridge—they've already invested a fair amount of resources in developing that. I stick to Objective-C for a number of reasons:
• I just prefer the language. IMHO, it's more powerful and elegant.
• There are still many Cocoa things that you can't yet do in Java.
• If frameworks, sample code, or other things come out, they're more likely to be in Objective-C.
• And probably others I can't think of at the moment...
Plus, you can use Java from Objective-C.
     
dogwood  (op)
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
Aug 28, 2002, 06:06 AM
 
I think that Cocoa Java is a good option for I can build,the base application in Java, bundle it for Windows Linux and Mac OSX as a Swing Application, then Convert the Java Swing to Cocoa Java application to make the application truly a native OSX application.

I must admit I have done no Cocoa Java coding. I am rather asking in this thread if people are using cocoa java and if is worth it.
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Aug 28, 2002, 06:54 AM
 
I know you're looking for some *positive* info on Cocoa Java, but I thought I'd give you a link to some more negative stuff...
http://www.bignerdranch.com/Resources/Java.html Sorry if you've seen it. But it raises some good points
     
dogwood  (op)
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
Aug 28, 2002, 08:11 PM
 
Thanks for the Big Nerd Ranch Link, what it is saying that in is current state, Cocoa Java is buggy and poorly documented, and this is because of it complexity.

This also leave open the chance that Cocoa Java can be made better by Apple. However since developers are failing to support the technology, I cannot see Apple bettering Cocoa Java.

The message is clear that I have heard by all I ask Cocoa Java is BAD. Do not use it or even think about it.

Sad but true it seems.
     
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Aug 29, 2002, 04:06 AM
 
Originally posted by dogwood:
I think that Cocoa Java is a good option for I can build,the base application in Java, bundle it for Windows Linux and Mac OSX as a Swing Application, then Convert the Java Swing to Cocoa Java application to make the application truly a native OSX application.
Keep the Java-code as it is and write the Mac OS X-specific part in ObjC. Use the Java bridge to talk to the cross platform-parts.
     
Forum Regular
Join Date: Nov 2001
Location: Australia
Status: Offline
Reply With Quote
Aug 29, 2002, 04:54 AM
 
Well I think it's worth it if you already know Java. If you NEED to develop something in OS X and don't have time to learn Obj C, cocoa-java is a good choice (cost of using java vs. cost of lost time due to learning Obj C). True, not all cocoa functions are supported, but you can work around the ones that aren't.

I will eventually learn Obj C, but for the moment I just wanted to get into OS X programming with minimal fuss. Besides, I like Java
     
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
Aug 29, 2002, 05:35 AM
 
It's a pity, really. Cocoa-Java would be Apple's best hope if they eventually decided to move away from Motorola chips.
All words are lies. Including these ones.
     
Dedicated MacNNer
Join Date: Nov 2000
Location: Malaysia
Status: Offline
Reply With Quote
Aug 29, 2002, 02:18 PM
 
Originally posted by sadie:
It's a pity, really. Cocoa-Java would be Apple's best hope if they eventually decided to move away from Motorola chips.


I can understand many developers might feel that Cocoa-Java is the best way for Apple to move into a broader group of DEVELOPERS, but it really has nothing to do with the platform. Objective-C can be programmed on anything that has GCC installed (linux by default, gnustep as an attempt to clone openstep).

Apple has already ported Darwin to x86. I would imagine that you can install gcc3 on an x86 machine running darwin and compile any obj-c command-line application. Once Aqua and all of the libraries needed for it (quartz/AppKit/etc) is ported and compiled on x86, cocoa as we know it will work fine.

If you want to do something "fun", get a copy of WebObjects. Install the Windows version. Pull up ProjectBuilder and use anyone's Cocoa/Obj-C sample calculator program. (I doubt that Cocoa NIBs will load into the "yellow box" version of IB) but you will be able to build the NIB from scratch and write the obj-c code and run a Rhapsody application natively on Winders. No java needed.

(I really do think this is a fun project--I happen to develop in WO, so I have the advantage of having x86 ProjectBuilder at my fingertips. You would be amazed at what OSX apps you could port to x86. Or better yet, what NeXT apps can be ported.)

---gralem

PS. Cocoa-Java is a fun technology to play with, but I agree with Aaron at BNR: no one should be developing REAL apps with it. Swing=Java/Cocoa=ObjC.
     
Junior Member
Join Date: Feb 2002
Location: Atlanta
Status: Offline
Reply With Quote
Aug 29, 2002, 07:36 PM
 
Originally posted by Ibson:
I know you're looking for some *positive* info on Cocoa Java, but I thought I'd give you a link to some more negative stuff...
http://www.bignerdranch.com/Resources/Java.html Sorry if you've seen it. But it raises some good points
Let's all remember however that Big Nerd Ranch is in the business of selling Obj-C/Cocoa books and training classes. They've invested many years in honing their Obj-C skills. (Long before OS X was even a twinkle in Steve's eye.) So to expect them to lovingly embrace Java/Cocoa might be asking a bit.

Me, I haven't had as much time as I'd like to work with Java and Cocoa so I can't make definitive statements, but I'm gonna say that I'm growing a bit tired of the "Java shouldn't be used for *real* stuff," attitude. Seems like given that GCC (at least in the non-Apple streams) now contains support for compiling Java into native code, Java could and should be a viable alternative for building "real" apps in Cocoa.

http://www.gnu.org/software/gcc/java/

I'll step off my soapbox and offer some useful, non-whining information. See the Learning Cocoa in Java site for juicy tidbits.

http://www.whiningdog.net/articles/LCIJ/page0.php

#gheff
     
dogwood  (op)
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
Aug 29, 2002, 09:00 PM
 
gheff is could not agree more that Java needs to come out of the shadows, and move toward being taken serious by developers and even Apple as first rate multi-purpose language.

I see Java having its weaknesses, - AWT/Swing - Performance and Speed - Garbage Collector and a slew of other stuff. See this article 10 Reasons We Need Java 3.0 http://www.onjava.com/pub/a/onjava/2.../31/java3.html However it has enormous developer support, and is generally a well thought out language. There is no reseon why Java cannot be improved and extended.

Going back to the thread, maybe Apple should not use the Cocoa Bridge. Rather add its own Java extension that gives Mac users a greater Java experience with out of the cost of linking into Obj-C. All at the same time not polluting the base Java classes.
     
Forum Regular
Join Date: Aug 2001
Location: Vienna, Austria
Status: Offline
Reply With Quote
Aug 30, 2002, 03:00 AM
 
Originally posted by V0ID:
Well I think it's worth it if you already know Java. If you NEED to develop something in OS X and don't have time to learn Obj C, cocoa-java is a good choice (cost of using java vs. cost of lost time due to learning Obj C). True, not all cocoa functions are supported, but you can work around the ones that aren't.
The general rule is that it takes one or two days to learn ObjC, and two weeks to a month to learn the Cocoa API, which is required for both ObjC and Java, and so learning ObjC is not costing that much, with the added benefit of better support and better integration into the C-only APIs of Mac OS X (Apple tries to make all new APIs C-only, for better integration into Carbon).


Besides, I like Java
Me too, but I've learned that you have to use the right tool(s) for the task. Don't use screwdrivers for nails.
     
Grizzled Veteran
Join Date: Feb 2001
Location: Pittsburgh
Status: Offline
Reply With Quote
Aug 30, 2002, 08:03 AM
 
The Cocoa/Java bridge always seemed like a waste of Apple's time.

If you're using java, then there is no reason not to use Java's APIs for everything but a native GUI. However, if you're going to code a native GUI, your code is no longer cross-platform. If you're code isn't cross platform, yet you've invested the time to learn the cocoa API, then you should _definately_ use Objective-C over java. The time it takes to learn Obj-C is trivial compared to the time it takes to learn Cocoa. Not only that, but the cocoa API is easier to learn and remember using Obj-C due to the verbose syntax of its message passing. Obj-C binaries are also much quicker than their java counter parts.

On a more positive note: Simply learning Objective-C and Cocoa has given me a lot of insight into language and API design. If you're willing to invest a couple days in Objective-C and a couple months on Cocoa, you're productivity could skyrocket. Although it could just depress you... This technology has been around since the Open-Step days and yet most programmers are still using inferior developement environments. IMHO java doesn't hold a torch to cocoa/obj-c. Even though the skills aren't directly marketable, I find myself striving to code things correctly/elegantly in other languages after seeing how good code could be with the right tools.

To summarize, its not worth using the java-cocoa bridge. Choose one side or the other unless you have a huge java code base onto which you want to bolt a native Aqua GUI.
     
Fresh-Faced Recruit
Join Date: Aug 2002
Location: Atlanta
Status: Offline
Reply With Quote
Aug 31, 2002, 09:41 PM
 
Originally posted by gheff:


Let's all remember however that Big Nerd Ranch is in the business of selling Obj-C/Cocoa books and training classes. They've invested many years in honing their Obj-C skills. (Long before OS X was even a twinkle in Steve's eye.) So to expect them to lovingly embrace Java/Cocoa might be asking a bit.
I assure you: If Java/Cocoa were a great technology, I would be the first to praise it. I would also be the first to teach it. When Apple had 25 Cocoa examples that they wanted converted to Java, I was the guy who did it. My opinions are based on experience, not on possible profits.

I like Java (I really do), but I wouldn't use it with Cocoa. I'd use Swing. I think most people at Apple would agree with me, but are not allowed to do so in such a public forum.

Learning Objective-C is not so painful if you want to write Cocoa applications (and I can recommend a good book). Learning Swing is not so painful if you want to write Java applications. Just make a choice and live with it.

Hear me now, believe me later: O'Reilly's "Learning Cocoa in Java" is a mistake. It is going to be a terrible book, and it is going to give good programmers bad ideas.

- Aaron Hillegass
(Last edited by BigNerdRanch; Aug 31, 2002 at 09:47 PM. )
     
dogwood  (op)
Junior Member
Join Date: May 2002
Location: Australia
Status: Offline
Reply With Quote
Sep 1, 2002, 04:19 AM
 
As the author of this thread, and having talked with Apple Java evangelist who in not uncertain terms told me DO NOT to use Cocoa Java it is that simple.

I must concede that Java and Objective-C were never meant to work together. I suppose the appeal of Cocoa Java was the capacity to give a more mac like experience for Java users under mac osx.

Their are a few areas that Java just comes a little short from giving the user that felling of satisfaction. I talk about things like java IO that JFileChooser , that gives that horrible MS Windows experience. for opening and saving files.

I am just learning Java, but why could Apple or some other developer inherit the base IO classes in Java, and creating some classes that make the Java experience more mac like. So that other developers may use these new classes on the Mac or even Windows. It would not need be only on the IO, it could be any area that Java experience comes up short on the Mac OSX.

----------------
AS A SIDE NOTE
----------------

I am not worried about Java's speed, I have been told by the Apple Java evangelist, that one of the reseons why Java 1.4 is running late because the Apple Java team is recoding the framework from carbon to objective-c. because carbon has reached the end of it scalability, for Java VM, and that objective-c will bring huge improvements in speed, and scaleability.
     
Junior Member
Join Date: Feb 2002
Location: Atlanta
Status: Offline
Reply With Quote
Sep 1, 2002, 09:05 AM
 
Originally posted by BigNerdRanch:


I assure you: If Java/Cocoa were a great technology, I would be the first to praise it. I would also be the first to teach it. When Apple had 25 Cocoa examples that they wanted converted to Java, I was the guy who did it. My opinions are based on experience, not on possible profits.

...

Hear me now, believe me later: O'Reilly's "Learning Cocoa in Java" is a mistake. It is going to be a terrible book, and it is going to give good programmers bad ideas.

- Aaron Hillegass
OK. Concerning your motives, I guess I'm convinced. I'll retract my "accusation."

Concerning "Learning Cocoa in Java," can you elaborate? What "bad ideas" is this book going to disseminate? (I'm not trying to be a snot here, I'm genuinely interested.)

For whatever it's worth, after posting my previous post, I picked up your book again, blew the dust off of it (literally ) and I'm working my way through it again. This time the Objective-C syntax isn't making my eyes cross as much, so maybe it's getting through my thick skull after all.

#gheff (Who hasn't done much C since Java came along.)
     
Fresh-Faced Recruit
Join Date: Aug 2002
Location: Atlanta
Status: Offline
Reply With Quote
Sep 1, 2002, 10:09 AM
 
I appreciate the kind retraction.

Originally posted by gheff:

Concerning "Learning Cocoa in Java," can you elaborate? What "bad ideas" is this book going to disseminate? (I'm not trying to be a snot here, I'm genuinely interested.)

"Learning Cocoa in Java" is bad for two reasons: 1) It is a port when it should be a rewrite
2) It teaches a weak technology

My feelings on the latter are in the essay referenced above. Let's address the former:

Once upon a time, before there was NSString and retain, there was a computer called NeXT. Colleges bought them by the dozen, and when they arrived, no one knew what to do with them. So NeXT wrote a handy example of how to get started with the tools. The example was TemperatureConverter. Then, NeXT developed OpenStep which they sold to corporate markets, so TemperatureConverter was ported to OpenStep (with NSString and retain) and renamed CurrencyConverter. Then, the sales engineers realized that they needed a couple of well-documented examples for people who were doing technical evaluations of OpenStep, so they wrote a technical sales piece called "Discovering OpenStep". They included the CurrencyConvert example, and added TravelAdvisor and ToDo. Then Apple needed a document to get people started with Cocoa, so they redid the screenshots and published it as "Learning Cocoa". Now, it will be ported once more to Java.

It was a decent sales piece when it was created, but it has been stretched into roles for which it was never intended. It has been touched by so many authors that it no longer makes sense. It should have been rewritten from the ground up several times by now.

If you were writing a new book on Cocoa/Java, would it look anything like "Learning Cocoa"? I certainly hope not. Starting fresh gives you a clearer focus -- one that O'Reilly needs desperately.

But of course, my main point is 2) such a book documents a bad way of doing things. It would be like putting out a book called "Cooking with Dull Knives" and its main selling point is: "Cook without ever having to sharpen your knives!" ("Program Cocoa without ever having to learn Objective-C!")


For whatever it's worth, after posting my previous post, I picked up your book again, blew the dust off of it (literally ) and I'm working my way through it again. This time the Objective-C syntax isn't making my eyes cross as much, so maybe it's getting through my thick skull after all.
I'm certain your skull is not so thick. I hope you like the book; it was a lot of work. It is not perfect, but I think it is a good starting place. Definitely worth keeping dust-free.

Good luck.

- Aaron
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Sep 1, 2002, 01:14 PM
 
Well, when I was learning my first langauge, Java, was also when the PB came out and I got hold of the developer tools. It seems like a reasonable idea to do Cocoa-Java. I got to learn the API's while building upon my growing understanding if object oriented programming.

Honestly, I'm glad I didn't try jumping to Obj-C right away. I was confused enough learning one syntax, let alone two different ones at the same time. Now being profecient in Obj-C, I can say that its really easy, but when you're first starting out, easy is a relative term.

My advice: if you're using Cocoa-Java to learnt the API's and all you know is Java, its not a bad thing. You can make better programs in Obj-C that will run faster and be more reliable, from the stand point of learning and creating things quickly, it isn't a bad deal.

Utlimately, use whatever language your comfortable with. I don't think people should be dictating what language you're using - if you want to use a lnaguage that will run slower, that's fine because you probably have other reasons for using it (such as familiarity, the ability to port a lot of the code over).

Oh yeah, and if you're a decent programmer, there's no reason why Java can't maintain some of its cross-platform ability. It's usually a good idea to separate exterior API calls from standard calls, so you can have all classes that don't depend on Cocoa which you can port between platforms.

Just my thoughts on the matter.
Matt Fahrenbacher
     
Forum Regular
Join Date: Jan 2001
Location: Boston, MA
Status: Offline
Reply With Quote
Sep 3, 2002, 02:22 PM
 
I originally started programming in Cocoa Java to get the hang of the Cocoa APIs while using a language I was already familiar with. However, I soon after discovered the joys of Objective-C. There are some legit reasons for wanting to program in Cocoa-Java though -- for me it's mainly to get access to Java Web Services framework from Sun. Apple provides a simple web services framework with 10.2, but it's nothing compared to what's available from Sun and IBM. Is Apple going to truly invest in web services and provide WSDL parsing and UDDI discovery and binding? Those standards aren't in widespread use now (although I'm using them) but as more of the web services stuff takes hold, Apple will be forced to either replicate all of that work in Objective-C or continue to improve the Java connection to Cocoa so developers can leverage this technology.
     
Forum Regular
Join Date: Jan 2001
Location: Boston, MA
Status: Offline
Reply With Quote
Sep 3, 2002, 02:27 PM
 
I originally started programming in Cocoa Java to get the hang of the Cocoa APIs while using a language I was already familiar with. However, I soon after discovered the joys of Objective-C. There are some legit reasons for wanting to program in Cocoa-Java though -- for me it's mainly to get access to Java Web Services framework from Sun. Apple provides a simple web services framework with 10.2, but it's nothing compared to what's available from Sun and IBM. Is Apple going to truly invest in web services and provide WSDL parsing and UDDI discovery and binding? Those standards aren't in widespread use now (although I'm using them) but as more of the web services stuff takes hold, Apple will be forced to either replicate all of that work in Objective-C or continue to improve the Java connection to Cocoa so developers can leverage this technology.
     
Forum Regular
Join Date: Feb 2000
Status: Offline
Reply With Quote
Sep 3, 2002, 08:02 PM
 
Originally posted by V0ID:
Well I think it's worth it if you already know Java. If you NEED to develop something in OS X and don't have time to learn Obj C, cocoa-java is a good choice (cost of using java vs. cost of lost time due to learning Obj C). True, not all cocoa functions are supported, but you can work around the ones that aren't.

I will eventually learn Obj C, but for the moment I just wanted to get into OS X programming with minimal fuss. Besides, I like Java
You are neglecting the fact that learning languages is, basically, fairly trivial. The difficulty with programming lies within the myriad of various programming APIs that need to be learned for a particular OS. i.e. generally in modern OS APIs there is about 10 times the amount of information contained within the API v. the actual language. e.g. What are the 2 million and one ways to create a new window(or even init an app for a particular task) in API x? (Cocoa, Carbon, X11, GTK, Qt, MFC, Motif, etc. ad nauseum)

A better answer would have been to make a Java/Swing app then convert it to Cocoa after taking the time with Cocoa.

Yes, yes, I ignore at least 2 things:
1. modern languages insist on packaging large APIs(basic & not so basic) of their very own with the language.

2. not addressing the peculiarities of each language, however, each language is usually very similar at the conceptual level and it generally only requires a good reference to transport the fundamentals across languages of similar types.

BTW: I'm not so certain that I would apply the term strongly typed to C++, or even C. Yes in some senses they are, but in many they may not be as well. i.e. mechanisms are provided to avoid this, and well abused generally.
     
Fresh-Faced Recruit
Join Date: Sep 2002
Status: Offline
Reply With Quote
Sep 4, 2002, 08:40 AM
 
Originally posted by dfiler:
If you're using java, then there is no reason not to use Java's APIs for everything but a native GUI. However, if you're going to code a native GUI, your code is no longer cross-platform. If you're code isn't cross platform, yet you've invested the time to learn the cocoa API, then you should _definately_ use Objective-C over java. The time it takes to learn Obj-C is trivial compared to the time it takes to learn Cocoa.
Obj-C may be easy to learn but I think there is more to a language than its syntax. One of the reasons to use java is the vast number of libraries available for it. If I had a program that for example had the Jetty web server embeded and used Apache's Xindice XML database internally it seems that it would take more than a trivial amount of time to port to Obj-C if I had to either rewrite those libraries or learn how to use a native replacement.

On another note, is there any reason that java couldn't be better integrated into building apps that use the native GUI? Is the problem in the bridge approach or in java itself? I know many say "just use Swing" but Swing is the slowest part of java apps and is noticeably different than a native app.
     
Forum Regular
Join Date: Feb 2000
Status: Offline
Reply With Quote
Sep 4, 2002, 06:48 PM
 
er... that was my point.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2