Each of the roles can also have its own properties, as can the
relationship. Applying this back to the binary relationship, we can see that this more
WHAT IS NEEDED IN A DSM ENVIRONMENT 369
general case applies perfectly well there too: the line type may almost always be the
same for both roles, but the symbols and properties will often be different for each role
and the relationship itself.
The simplest kind of n-ary relationship is one where a role can be repeated
multiple times, for example, multiple ???To??? roles in a Data Flow Diagram, or multiple
???Specialization??? roles to subclasses in a Class Diagram. This can be speci?¬?ed as the
cardinality of the role in that kind of relationship. More complicated cases, for
example, the Transition in the WatchApplication modeling language in Chapter 9,
will have several different roles, each with their own cardinality, and each with a
different set of object types it can connect to.
Weaker metamodeling languages that only support binary relationships generally
attempt to make the excuse that an n-ary relationship can be replaced by a new object
with a relationship to each of the connected objects. This is a poor workaround, as it
loses the ability to check the legality of the relationship, or at best makes such checks
much harder. Of course, most relationship types in modeling languages will be
binary, as will most instances of them in models; still, having the choice to use n-ary
relationships when you need them is a useful feature.
Pages:
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707