If performance is not a major concern
for the data in question, it may be easiest to keep the internal format similar to the
human-readable format and provide machine-friendly getters. This will keep the
data structure de?¬?nition in close correspondence with the modeling language, and
keep instances in a format recognizable to the modeler (e.g., if he has to resort
to source-level debugging). Should performance constraints arise later, the variable
in question can be changed to a machine-friendly format. If there is a strong need
to maintain the human-readable format, an extra variable can be added to cache
the machine-friendly format.
Where performance is at all a concern, or when that area of the DSM solution
has become stable and is no longer being changed, the domain framework can
offer a constructor or setters that take the human-readable format as arguments,
and ?¬?ll the machine-readable format into the data structure. In most cases, such
data structures are read-only after construction. If they will be modi?¬?ed later
PROVIDING AN INTERFACE FOR THE GENERATOR 319
by the framework??”for example, if the model is simply specifying an initial set of
values??”there should also be direct setters, which would take an argument in the
machine-readable format.
12.3.2 Integrating Code Speci?¬?ed by the Model
Only in simple cases can a framework be turned into an application purely by
con?¬?guring it with data from models.
Pages:
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598