It was also thought that the number of actions needed to make an
icon behave as desired would probably be less than the total number of states in that
application, making modeling easier if actions were used. We thus decided to
represent the icons as objects in the modeling language, and to allow modelers to
change their state by drawing a relationship to the icon to turn it on or off. The result so
far, after 40 minutes of metamodeling, is seen in Fig. 9.1.
9.3.3 Watch Applications Manipulate Time
After the work so far, we could model a stopwatch that would know which state it was
in (say, Stopped or Running), move between those states when the user pressed a
button (say, Up), and that would also turn on or off the Stopwatch icon when moving
FIGURE 9.1 States, buttons, and icons (40 minutes)
196 DIGITAL WRISTWATCH
between the states. All very well, but it might be useful if the stopwatch actually
recorded something about the elapsed time, too!
If Buttons represented a Controller in the MVC triad that Secio envisaged, and
Icons represented aView, then being able to record elapsed time was clearly part of the
Model. Storing, recalling, and performing basic arithmetic on time variables were
therefore important parts of watch application behavior that we needed to represent in
some way in the modeling language.
Pages:
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364