Architecture of NewtApp

Entry Layer

This layer corresponds to one soup entry. It stores a soup entry as a slot and is responsible for reading the entry from the soup, and for saving the entry back to the soup when it is changed.

It saves the entry to the soup using a watchdog timer. Approximately five seconds after a change has been made to a soup entry, it is written back to the soup.


Note:Using a watchdog is safer than writing the soup entry only when the user is finished with it. The user may let the Newton sleep while an application is open and scrolled to a particular soup entry. If the entry can't be saved until the user switches to another entry, it could be quite a wait (especially if the user has made your application the backdrop application).
An alternative approach would have been for the entry layer to write the soup entry back to the soup every time a change was made to the entry. This isn't done because saving soup entries is relatively slow (taking substantial fractions of a second, depending on the number of indexes). Imagine a string slot that the user edits by typing on a keyboard (either on-screen or external). Every keystroke changes the text. It certainly would be overkill to save the soup entry on every keystroke.


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

Last modified: 1 DEC 1996