If this is the case, the
information needed by the generator at a given stage of generation will generally be
found from the same model the generator is currently in. A generator will not need to
hop back and forth much between different models in different modeling languages: if
that were the case, the modeler would most likely have to perform similar mental
acrobatics in creating and reading the models.
GENERATOR STRUCTURE 299
The partition of the domain into modeling languages tends to offer a good basis for
partitioning the generator. Following the same partitioning closely also brings the
bene?¬?ts of simplicity to the metamodeler. Associating each generator with one
modeling language gives an encapsulation of data and behavior similar to that found
in object-oriented programming. The modeling language de?¬?nes the data structure,
and the generator is the code that operates on the data.
Autobuild thus often calls a top-level generator per modeling language. The top
model may generate signi?¬?cant code itself, in which case it will have a top-level
generator in addition to the autobuild generator. Alternatively, the top model may be
more like a set of links to the real models, with little other content of its own. In that
case autobuild will simply iterate over the links, calling the appropriate top-level
generator for each target model.
Pages:
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559