Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesYellow Box's API Goes Cross-Platform


July 1997 / Core Technologies / Yellow Box's API Goes Cross-Platform

With frameworks across the Mac, Unix, and Windows, could Apple's OS become the best development platform?

Justin Morgan

The foundation of Apple's Yellow Box is Next Software's OpenStep, which was originally an open API designed for building cross-platform object-oriented programs. This specification was implemented by Next as a group of object frameworks and supporting tools that are analogous to the Microsoft Foundation Classes (MFC) and Metrowerks' PowerPlant library. Java's class libraries are similar to Yellow Box's framewo rks, but Yellow Box applications run much faster because they are compiled.

Yellow Box Everywhere

Yellow Box (also referred to early on as "Concert") comprises a suite of tools and frame-works adapted for the Macintosh from Next's OpenStep products. OpenStep is the fourth iteration of NextStep, one of the most advanced development envi-ronments for the past 10 years. A large number of software developers have successfully leveraged OpenStep to quickly create custom applications for Fortune 500 corporations.

As a result, Next has refined its frameworks and tools to a sharp edge, and Yellow Box has thus become one of the best environments for rapidly prototyping and deploying custom applications. Yellow Box applications can be cross-compiled and deployed in a matter of hours for the next-generation Mac OS on PowerPC, for Windows NT and 95 on x86 processors, and for Sun's Solaris systems.

Unlike some cross-platform environments, Yellow Box-built applic ations have the exact look and feel of the target platform. Thus, Macintosh applications written with Yellow Box look and feel just like all other Macintosh applications. If the same Yellow Box source code is compiled for Windows, then the resulting applications will feel and behave just like any other Windows applications.

Frameworks in a Nutshell

Yellow Box's object frameworks do not ship with source code; they come with only headers and a library. But they can be extended by subclassing or through the addition of Objective-C categories (see "An Introduction to Objective-C," June BYTE). Also, each framework is abundantly documented and indexed, in both hard copy and on-line documentation. What follows is a review of each of Yellow Box's major frameworks.

The Foundation Kit is Yellow Box's central framework. This comprehensive kit includes core objects, such as NSObject (the superclass for all other classes), which all the other frameworks use. The Kit contains Yellow Box's classe s for collections, run loops, strings, numbers, exceptions, threads, dates, and many others. It contains no GUI-related objects; this allows developers to create programs that run from a command line, such as Unix daemons or command utilities.

The Application Kit is an extensive framework of classes for creating GUIs. These interfaces feature the exact look and feel of the target environment. The AppKit is based on several industry standards. For example, on-screen drawing is done using Adobe's device-independent Display PostScript. The text-related objects in Yellow Box can emit formatted text using Microsoft's Rich Text Format (RTF) standard.

An innovative development tool, called Interface Builder (IB), works with "live" AppKit objects for rapid application development (RAD). With IB, developers can lay out an application's visual interface, graphically connect the visual objects using a target/action paradigm, and then test the application without recompiling. When the developer has got the right interface -- after several quick iterations -- the layout data is saved in a file. This file is later used as a resource when the application is compiled to build a stand-alone application.

The Web Objects Framework (WOF) is a tool for turning mission-critical data into fancy, dynamic Web sites. The WOF gathers data from any data source, such as a database or mainframe, and packages that data into objects. These objects run within server applications, and the objects know how to graphically represent themselves by emitting HTML. This allows any modern Web browser to act as the viewer for WOF applications. The figure "Web-Objects Interaction" shows how the various software components of a Web Objects site relate to each other. Finally, Java development is also an integral part of WOF.

WOF works well within existing corporate environments by adhering to existing standards. The Web-based applications that it creates can contain frames, forms, and any other stan dard HTML constructs. In addition, security features, such as Secure Sockets Layer (SSL), S-HTTP, and firewalls, work with WOF.

The Enterprise Objects Framework (EOF) provides object-oriented access to relational databases. EOF is a database-independent persistence API, and it works well as a persistence mechanism for Web Objects or any Yellow Box application. Conceptually, EOF maps a DBMS table definition to a class. Each row in a table therefore represents an instance of that class.

EOF supports access to many vendors' databases by using an adapter that translates EOF's object-oriented application-level API calls to corresponding low-level Informix, Oracle, Sybase, or ODBC calls. EOF has an open, extensible architecture and can support any RDBMS/OODBMS; third parties are working on adapters that access other databases.

Distributed Objects (DOs) are an integrated part of Yellow Box, but they don't belong to a framework per se -- any class developed with Yellow Box is potentially d istributable. DOs offer a powerful mechanism for locating and accessing remote objects.

Yellow Box's DOs are not CORBA-compliant, but Apple might add hooks to CORBA in the near future. In the meantime, Apple's Portable Distributed Objects (PDO) product allows objects to be compiled and deployed on all popular Unix variants. This lets such compute-intensive objects reside on high-powered servers and interoperate with any Yellow Box object on a network.

Windows developers will be happy to learn that Yellow Box tools on Windows support OLE connectivity via OLE Automation. Apple also offers a tool, called D'OLE, that works as a bridge between OLE and PDO. This pair of products makes OLE into a viable multiplatform distributed-object solution.

Cross-Platform Development?

As this article illustrates, Yellow Box allows developers to create and deploy solutions on the Mac, under Windows or Unix, or on any combination of these. Yellow Box offers a wealth of tools and frameworks for build ing applications or Web sites that utilize existing databases. Furthermore, legacy systems can be easily integrated with Yellow Box. The figure "Yellow Box Components on a Sample Network" shows some sample Yellow Box components and the machines on which they would commonly run.

All this might seem like a programmer's nirvana, but there are still many remaining issues to be resolved before Rhapsody and Yellow Box come to market. Probably the most visible problem for Yellow Box developers is the learning curve for Yellow Box frameworks. Learning Objective-C is easy and takes only a few days. Because of Yellow Box's clear and intuitive interface, the development tools are easy to learn as well. However, acquainting one's self with the entire set of frameworks can take several months. Fortunately, developers generally need to learn and use only a subset of each framework.

Another issue is that it's hard to find experienced OpenStep developers. Apple's developer-relations departme nt must strive to entice developers to learn Yellow Box; otherwise, some corporations and independent software vendors will shy away from Yellow Box because it's easier to find C++ developers. Apple can help by keeping the developer-entry costs low -- a lesson that Next never learned.

Although Yellow Box is already standards-based, Apple should strive to add standards compliance wherever possible. For example, developers would welcome a fully CORBA-compliant Distributed Objects system, or an Object Database Management Group (ODMG)-compliant option for database connectivity.

In the final analysis, these nits are insignificant in comparison to the incredible flexibility and power of Yellow Box. Any developer who has used Yellow Box will tell you that it's a compelling environment for anyone who wants to develop a single source base and then deploy it on the Mac, Windows, and Unix. Apple's Yellow Box is clearly an excellent solution for almost anyone, even those who only do Windows.


Web Objects Interaction

illustration_link (19 Kbytes)

Web Objects can package any sort of data and export it as HTML for use in any Web browser.


Yellow Box Components on a Sample Network

illustration_link (22 Kbytes)

Enterprise Objects allow access to any database, and Web Objects enable clients to view them with a Web brwser.


Justin Morgan has been programming OpenStep/NextStep since it was available only in a black cube. You can reach him at jmorgan@objectronics.com .

Up to the Core Technologies section contentsGo to previous article: Go to next article: JavaOS: Thin Client, Fat ServiceSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network