Apple Newton Utilities Guide de l'utilisateur Page 450

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 449
CHAPTER 11
Data Storage and Retrieval
11-18 About Data Storage on Newton Devices
All frames are compressed automatically when they are stored as soup entries and
all soup entries are decompressed when they are referenced. The automatic
compression and decompression of soup data reduces the amount of storage space
and run-time memory required by Newton applications.
If you add a frame that references another entry, the referenced entry is copied as a
frame into the new soup entry that is created. Similarly, if you move that entry to
another store, any data it references is moved to the new store as well.
The only way to retrieve an entry is to send the
Query message to the soup or
union soup in which the entry resides. This method returns a cursor, which is an
object that returns entries in response to messages it receives.
As rst returned by the cursor, the entry is a frame that holds references to the
entry’s data. Soup data referenced by this frame is not decompressed until it is
referenced—for example, to get or set the value of one of the entry’s slots. When a
slot in the entry is referenced, the system constructs the entire entry frame in the
NewtonScript heap.
Decompressed entries are cached in RAM until they are written back to the soup.
Applications can modify these cached entry frames directly. The system supplies
functions for modifying entries, writing them back to the soup, and manipulating
them in other ways.
For information about using entries, see the section “Using Entries” beginning on
page 11-57.
Alternatives to Soup-Based Storage 11
Although soup-based data storage offers many advantages, you may improve
your application’s performance or reduce its RAM requirements by storing data
in other formats.
There are a wide variety of trade-offs to consider when choosing a structure to
represent your application data. You are strongly advised to conduct realistic tests
with the actual data set your application uses before committing to the use of a
particular data structure. It’s also recommended that you design your application in
a way that allows you to experiment with the use of various data structures at any
point in its development.
When choosing schemes for storing your application’s data, you need to consider
factors such as:
the kind of data to be saved
the quantity of data to be saved
how the application accesses the data
Vue de la page 449
1 2 ... 445 446 447 448 449 450 451 452 453 454 455 ... 941 942

Commentaires sur ces manuels

Pas de commentaire