Most early APIs
limited the generator to running on the same platform, and indeed the same machine,
as the modeling tool, but more recent work removes these restrictions.
An external generator API can be either message-based or data-based. In the
former, the model data remains in the modeling tool, and the tool??™s API only passes
pointers or proxies for those objects to the generator. The generator can still be
written as if it were operating on local data, but all calls are actually proxied through
to the modeling tool, and only further proxies or primitive data types like strings or
integers are returned.
In data-based APIs, calling an API function returns the actual data structures, or
rather a copy of them, to the generator. This requires the duplication of the data structure
types and functions in the generator. It also brings the problemofwhere to cut themodel
up: if the generator requests a graph, dowe return the whole data structure of the graph,
all its objects, all their subgraphs, and so on? If we do not, theremust be some method to
determine which parts of the data are to be returned in full and which as proxies.
270 GENERATOR DEFINITION
A well-made API of either type will behave similarly to the other type: no long
delays and running out of memory in a data-based API, or apparent instant access to all
data in a message-based API.
Pages:
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498