Application Layer
By: Mike Yocom - Revised: 2006-06-06 devinIntroduction
Discusses Mac OS X's application technology including Classic, Carbon, Cocoa, and Java 2.
Because Mac OS X is a completely new operating system than the classic Mac OS, older Macintosh programs won't run in Mac OS X without modification. One of the two ways Apple addresses this is with the Classic compatibility environment. Classic launches a virtual machine that runs a version of Mac OS 9 within Mac OS X. Programs that were made to Apple's specifications will run in Classic the same as they do in Mac OS 9.
Programs running in Classic will not get any of the advantages of Mac OS X. If one Classic application crashes, all of them will crash — but, Mac OS X-native programs will not be affected, and the computer will not need to be restarted. Classic is meant as a "get by" system to run old programs at the same time as programs that have already been ported to Mac OS X.
Carbon is the second way that Apple addresses the transition to Mac OS X. Carbon is a series of updated code libraries that allows programs to quickly port old programs to Mac OS X with just a little bit of tinkering — as opposed to a full re-write. Carbonized applications will run in Mac OS X as well as Mac OS 8.1 or later with "CarbonLib" installed. When running in Mac OS X, Carbonized applications will take advantage of Mac OS X's advanced features: Protected Memory, Preemptive Multitasking, Symmetric Multiprocessing, etc. If a Carbon application crashes, just that application crashes. However, Carbon applications won't take complete and total advantage of Mac OS X's abilities.
Carbon applications running in classic Mac OS also don't use any of Mac OS X's advanced features, so they are still susceptible to instabilities caused by other programs when running outside of Mac OS X.
Cocoa is the descendent of NeXT's OpenSTEP software development environment. Like OpenSTEP, Cocoa is designed for creating compact, efficient code that can be easily recycled in other projects.
Programs created using Cocoa — whether they are programmed in C, Objective-C, C++, or Java — will be Mac OS X-only applications, but will take maximum advantage of what Mac OS X has to offer.
Cocoa can also be used to quickly port programs from other platforms to Mac OS X. In most cases, most of the original source code can be brought across unmodified, which Cocoa used to implement Mac OS X's interface for the program.
Java — the de facto standard for creating programs that can be written once, and then will run on any platform, especially on the internet — Is tightly integrated into Mac OS X. In fact, Mac OS X is currently the only mass-market, desktop operating system to fully support the Java 2 standard.
By using a highly-optimized — but fully standards-compliant — Java implementation, means that any Java application running on Mac OS X will automatically take advantage of Mac OS X's advanced features — making Java applications run much smoother and quicker on Mac OS X. Java applications can even be run not just within a web browser, but within the Applet Launcher program, where they look and behave just like a normal, made for Mac OS X application.