What then about the Stopwatch,
what is it displaying? That seems to vary a little: initially, it just displays all zeroes;
when it is running, it is displaying the elapsed time, which is updating constantly but
always equal to the current time minus the original saved starting time. If we look at
World Time, that displays the current system time adjusted by some ?¬?xed offset.
A Countdown Timer displays the time the alarm will sound minus the current
system time.
This is interesting: we seem to be able to express quite simply the basic idea of what
each application should be displaying. This is actually not all that surprising: if the
time value displayed required some immensely complicated algorithm to calculate,
few people would be able to interpret its values. Of course, actually making the value
display and update smoothly will be tricky??”real-time software always is??”but
perhaps the models themselves can remain quite simple. Could we abstract out the
complicated parts of real-time display into the domain framework? This would allow
the model to simply specify what to display, while an expert developer??™s handwritten
code, written once but reused for all displays in all watch applications, would handle
how to display it.
In our blessedly deep ignorance of the intricacies (and bugs!) of Java??™s thread
handling and synchronization, we decided to take this path.
Pages:
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369