194 DIGITAL WRISTWATCH
9.3.2 Watch Application Behavior
While the family model would have been easier to work on, we decided to tackle the
watch applications next. If DSM were to mean anything, it would have to be able to
specify the differing behaviors of the various applications suf?¬?ciently exactly that we
could generate full code directly from the models. One possible tactic at this point
would have been to hand code a couple of watch applications. This would have given
us an idea of what kind of behavior they would actually have on a low level, as well as
insights into what elements of that behavior might repeat over several different watch
applications. However, as neither developer had programmed in Java at this point, it
was thought that trying to go this way would be a bad idea. DSM is generally about
abstracting from the best practice, and clearly there was no way our ?¬?rst attempts
would ?¬?t into that category.
Instead, we decided to concentrate on the actual user-visible behavior of the watch
applications, and trust that our general development experience and instincts would tell
uswhenwehad a suf?¬?ciently exact speci?¬?cation to enable full code generation. The?¬?rst
question was thus about the buttons, the only way the end user can interact with the
watch:When a user presses a button in a given application, does that button always have
the same effect? In other words, could we program a watch as a composition of
applications and an application as a composition of button behaviors? In some simple
cases, this appeared to be true.
Pages:
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361