In practice, there are at least
a couple more ways, ranging from simple programmatic access to the models to
crawler-based generators outputting multiple streams, and even generators that are
themselves the output of other generators.
11.2.1 Programming Language Accessing Models Through an API
The minimal facility necessary for generation is programmatic access to the models.
In an open source modeling tool or model repository, the programmer can code
generators directly against the model data structures. While initially such direct
access may feel welcome, the low-level programming it requires, together with the
unpleasantly high coupling between the generator and modeling tool, mean this is
normally only used where an organization has hand coded the modeling tool
themselves. Even then, as the tool matures the bene?¬?ts of separating the implementation
of modeling and generation become apparent. The need for higher-level
commands to read, navigate, and output model structures also quickly leads to a
separate generator component.
Direct access to model data structures also forces the generator to be built in the
same programming language as the modeling tool and to run in the same memory
space. To solve these problems and alleviate those mentioned above, tools often offer
an Application Programming Interface (API) for model access.
Pages:
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497