Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SWT, AWT, Swing, ...what about Cocoa?



From: Steve Klingsporn <email@hidden>
Date: Wed Oct 2, 2002 2:17:07 PM America/Chicago
To: Edward Kenworthy <email@hidden>
Subject: Re: SWT, AWT, Swing, ...what about Cocoa?


What I'm getting at is that if you separate the logic (model) from the custom and platform views (view) and the code that ties the two together and responds to events and such (controller), and in the controller, you separate out the code that actually "does something" from the code that responds to events and what-not, you can add your "actions" and "outlets" that Interface Builder expects, and walk away with a very nice Cocoa application. I recently took a game that I'd written with the model separate and the view and controller as an Applet (later turned into an application and a MIDlet prototype) and rewrote the view and controller parts to yield a Cocoa version of my game in a few hours of work. Of course, I've spent the past week tweaking it and adding more features, but coming away with a native-feeling Mac application after a week's worth of work is pretty good.

Of course, with a large application that's already been written, things might not be so easy, but you can have two sets of parallel interface code in there if you want to, and can "factor out" the common logic. Just work, like anything else.

One of the strengths I see with Apple's Java strategy on the Mac is you truly can have native applications that are Java-based on Mac OS X -- native from the perspective of not calling into some look & feel in Swing that tries to mimic the constantly-evolving Aqua look & feel. I think this is a big win, regardless of how you look at it, especially given the fact that Mac users want a "real" experience.

One of the key complaints about Java is the lack of quality in Sun's user interface toolkit implementations. I've dealt with all of them, and find that writing a Cocoa app (if my only target is the Mac) is a very nice choice. When I'm done with the Cocoa version of my game in a few days, I'll ensure that the changes I made to the game model work okay in the old Application version, will add network play to it, etc. I might make it a Swing application, but it's not a high priority for me.

Steve

On Wednesday, October 2, 2002, at 01:56 PM, Edward Kenworthy wrote:

Even If I think this practice is a sound software-engineering practice, I do not think you can easily achieve cross-platform GUI through this.
A typical GUI application will contain between 70% and 80% of your code devoted ti GUI-related stuffs. Porting an application using the MVC technique and building platform-dependant GUIs will therefore mean to re-write 70% to 80% of your application for each platform you're targetting.
This is something that will be refused by all my customers :-)


I don't believe that would be true of any properly written Java apps. Sure, if you write VisualBasic (spit) style and mix all your business logic in with the GUI then you're asking for trouble - but that's a coding issue, not a Java/AWT/Swing/Cocoa/whatever issue.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.