Unlike object-oriented classes, the object types have no notion of hiding the
GENERATOR STRUCTURE 301
implementation of how they store their information. Access to the properties of
the object is direct, and access to relationships and subgraphs of the objects is generic,
working the same regardless of the type of the object.
Some DSM tools equate models and their elements closely with object-oriented
classes: any information accessmust be carried out followingthe rules of statically typed
languages.Asidefromtheextraworkthisentailswhenwritinggenerators,suchtools also
often choose to make access to relationships happen through objects: an object stores its
own relationships. The problem of this becomes apparent when you want to reuse the
same object in a different model: you may well want it to have different relationships
there, but the generator cannot tell which relationships belong to which model.
A more useful approach is to recognize that information about which relationships
connect which objects belongs to the model. Since while generating we are always
within a particular model at any given time, we can always follow the relationships of
an object in that model. This also allows the generator language and generators to be
simpler: there is one global mechanism for following relationships, specifying the
type of the relationship as an argument, rather than having a separate message for each
kind of relationship for each object.
Pages:
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564