Apple Newton Utilities User's Guide Page 434

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 433
CHAPTER 11
Data Storage and Retrieval
11-2 About Data Storage on Newton Devices
Introduction to Data Storage Objects 11
Newton devices represent data as objects. The NewtonScript programming
language provides four basic object types that applications can use to
represent data:
Because immediates, binaries, and arrays are object representations of data types
common to many programming languages, they are not discussed further here. For
complete descriptions of these objects, see
The NewtonScript Programming
Language.
The frame is of particular interest, however, as it can contain any of the other
objects and is the only NewtonScript object to which you can send messages. In
addition, the following characteristics of frames make them a particularly exible
and efcient way to store data:
Frames are sized dynamically—they grow and shrink as necessary.
All frames support a common set of predened NewtonScript data types that
allows them to share most data virtually transparently.
Dissimilar data types can be stored in a single frame.
Like a database record, a frame stores data items. An individual data item in the
frame is held in a slot, which may be thought of as a eld in the database record.
Unlike database records, however, frames need not contain the same complement
of slots.
Any slot can hold any NewtonScript data type, including strings, numeric formats,
arrays, and binary objects. Note that NewtonScript does not require that slots
declare a datatype. Slots are untyped because every NewtonScript object stores
datatype information as part of the object itself. (NewtonScript variables need not
declare a type, either, for the same reason.)
Slots can also hold other frames, as well as references to frames, slots, and
NewtonScript objects. A frame’s ability to reference other frames from its slots
allows it to inherit attributes and behaviors from ROM-based objects known as
system prototypes or “protos.” This feature of the object system also provides
dynamic slot lookup and message-passing between frames. For detailed
descriptions of NewtonScript syntax, system-supplied data types, dynamic slot
Immediate A small, immutable object such as a character, integer or
Boolean value.
Binary Raw binary data.
Array A collection of object references accessed from a
numerical index.
Frame A collection of object references accessed by name.
Page view 433
1 2 ... 429 430 431 432 433 434 435 436 437 438 439 ... 941 942

Comments to this Manuals

No comments