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 > Turning a small Java app into a Cocoa app

Turning a small Java app into a Cocoa app
Thread Tools
Mac Elite
Join Date: Sep 2000
Location: New York
Status: Offline
Reply With Quote
Jun 13, 2001, 03:02 AM
 
I'd like to preface this all by saying that I am new to Java (just started learning) and I am doing a summer project in this computer science program at my school. I'm working with a partner and the profs are very confident that we'll be able to get a lot done. We've decided to work in and learn java, as many of the other students in the program have. When we are done we will have a small java application. I would really like to know how much work it would take to make that Java app into a real cocoa app, Aqua interface and all.

The program will have one window. It will do the following things: index the contents of a user's folder on their local hard drive, send that list over a network to another computer running the server app (in java), and open links (hyperlinks i guess) to files located on the campus network. It doesn't seem too complicated of a thing to do.

I wish I was allowed to do it all in Cocoa from the get go. Actually, if someone could tell me that writing this app (and the server app, which will be responsible for receiving the indexed lists from many client apps, keeping them all together in one big list, and then allowing the client program to search the list and send back results) in cocoa would be much quicker and easier, and I could prove that to the professor then I maybe I could do it. I would be really excited to do this all in cocoa, but if I can't I'd really like to know how much work would be involved to turn that java app into a real cocoa one. Thanks.
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jun 13, 2001, 03:42 AM
 
I think it would be quicker and easier to do this in Java. Basically because Java has all sorts of nice things built in which Cocoa lacks. Plus, Java is documented! If you are careful to separate the UI from the under-the-hood stuff -- which in this case shouldn't be very hard to do -- then it will be easy to put on a Cocoa front-end.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 13, 2001, 12:17 PM
 
Originally posted by tie:
<STRONG>I think it would be quicker and easier to do this in Java. Basically because Java has all sorts of nice things built in which Cocoa lacks. Plus, Java is documented! If you are careful to separate the UI from the under-the-hood stuff -- which in this case shouldn't be very hard to do -- then it will be easy to put on a Cocoa front-end.</STRONG>
I hope both of you realise you can access Cocoa from Java? You make it sound like Cocoa is a language. I haven't really heard of anything that Java has but Cocoa doesn't...
     
Mac Elite
Join Date: Sep 2000
Location: New York
Status: Offline
Reply With Quote
Jun 14, 2001, 12:21 AM
 
Yea I know that you can write cocoa apps in java, but I wanted to know how to take this java application and turn it into a cocoa app. I've learned that using the swing interface stuff I can make an app that uses the cocoa interface, so I think I'll just stick with that. It seems good enough. Thanks.
     
Fresh-Faced Recruit
Join Date: Apr 2001
Status: Offline
Reply With Quote
Jun 14, 2001, 12:58 AM
 
IMHO, you ought to stick to java for this. For one it's more portable, good in a heterogeneous network like that of a university. If you still want to write it in Cocoa, I'd write the UI in Cocoa (because it's way easier than swing. swing....bleech). Writing the whole thing in Cocoa/ObjC would be kind of ugly because you'd have to go all the way down to BSD sockets, whereas with java you have the java.net.* package with nice clean documentation. Also, if you write the UI in cocoa and adhere to the MVC application model, you can reuse all the client application underpinnings should you decide to write an all java client.
     
Junior Member
Join Date: Mar 2001
Status: Offline
Reply With Quote
Jun 14, 2001, 01:12 PM
 
Doing networking with Java is also much nicer than with Cocoa. The best way to do Cocoa networking, according to Apple, is with BSD sockets!

-Peter
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 14, 2001, 01:43 PM
 
Originally posted by Wixar:
<STRONG>Doing networking with Java is also much nicer than with Cocoa. The best way to do Cocoa networking, according to Apple, is with BSD sockets!

-Peter</STRONG>
I'm not sure if BSD sockets are as complicated as they're made out to be, and OmniGroup has a wonderful framework called OmniNetworking which provides an Objective-C wrapper to the BSD socket API. You're still confusing Cocoa with a language -- it isn't.
     
Fresh-Faced Recruit
Join Date: Jun 2001
Status: Offline
Reply With Quote
Jun 15, 2001, 04:11 AM
 
If ya use Cocoa-Java & follow MVC pattern the port should not take more then a day right?
     
   
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 09:51 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