Slot Assignment

Objects Should Be Independent

In cases where multiple objects inherit from the same proto, a change to one of those objects should not affect any of the others. For example, in FIGURE 4.4, you could assign a new value to the viewFormat slot of groceryListTemplate (see "viewFormat" on page 115):

groceryListTemplate.viewFormat := // black lines
You would not want this assignment to affect the way the lines look in errandsListTemplate or choreListTemplate. To change the viewFormat slot in all templates, you would change the viewFormat slot in listproto itself.


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

Last modified: 1 DEC 1996