With only three cases, however, and none of these being impossibly complicated
with the existing modeling language, we decided to leave the extension until later.
Rather than creating a new concept for this particular kind of repetition in the models,
it might prove to be better to identify several kinds of repeated patterns and come up
with a more general way to specify parameters to a subapplication. In the long run, this
approach would probably have allowed more expressive power with a smaller set of
concepts.
9.4.2 Watch Application Metamodel
For completeness, Fig. 9.9 shows the full metamodel for Watch Applications.
FIGURE 9.9 Watch application metamodel
MODELS 211
9.5 CODE GENERATION FOR WATCH MODELS
Generators were built for watch models to both Java and C. We will look at each in
turn, focusing ?¬?rst on Java.
9.5.1 Java Generator for Watch Models
In the watch example, the generator goes beyond simply producing Java code
corresponding to the models: It also takes care of creating and running build scripts,
and ensuring that the domain framework is available. Generation proceeds with the
following steps:
(1) The batch scripts for compiling and executing the code are generated. As the
mechanisms of compilation and execution vary between platforms, the
number and content of the generated script ?¬?les depend on the target platform.
Pages:
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391