On 2004-12-02 05:53:48 +0100, Barry Lay <blay@xxxxxxxxxxxxxxxxxxx> said:
I have a requirement for a non-binary association between objects, and
am curious about how one might model it graphically.
I think there are two possibilities:
1) Model the association as (invisible) node
The association is modeled just like the assiciation in UML 2. The
association is represented as a node, and every linked "real" node is
connected with a binary connection. Maybe it's possible to hide the
association node itsself, e.g. by creating a figure with dimension (0,0)
or (1,1). If you have to move the association node -- the user is moving
the center point of the n-ary association -- the bounds of the node
might be greater and you have to provide proper anchor points. The
advantage of this apporach is that you have to managy binay connections
only.
2) Model the association as Connection and Node
You can implement both interfaces, the Connection and the Node
interface. That's no problem. I've implemented a class diagram editor
and I needed this for conecting Comments to a Relationship, e.g. connect
a Comment to a Generalization with a CommentLink-Connection. The result
may look like the first approach and you can use bendpoints for the same
puprpose as the center node in the first approach.
Depending on where and how may labes and other decorations you have to
provide, maybe the first or the second approach are more suiteable for
you. Maybe I like the first case more since it's more straight forward.
Jens