Introduction

Persistent Objects

On most platforms, applications save data in specialized application and file formats (see FIGURE 9.1). Object-oriented applications that inhabit this world must convert their data objects to some arbitrary flat file format at write time and convert back at read time.

Newton provides a different type of data world. Rather than writing files, you store objects. Since you are storing objects, they are accessible to everybody without any conversion. On Newton, the data object is a frame. Every application can store frames, retrieve them, and modify frames they created or ones they did not (see FIGURE 9.2). In addition, searching for particular information is a straightforward process. Any application can search for a given frame or a set of frames that satisfy some criteria.

FIGURE 9.2 : The Newton model of data and storage.


Within this data model, what remains consistent is the structure of the data object. Thus, we use the phrase persistent object to refer to these objects. They persist while stored and do not require explicit code to write them to or retrieve them from a file. On Newton, these persistent objects are called entries.

There are two advantages to storing objects directly:

On traditional platforms, applications have unique file formats that make sharing data a complex issue. On Newton, all storage is done using frames. Sharing data is as easy as retrieving a frame and accessing its slots.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996