The diagram interchange model can be used with the UML metamodel to represent any UML diagram type through a graph with semantic links to the UML metamodel. For most of the UML diagram types there is an intuitive way to represent them as a graph. Sequence diagrams, however, are somewhat different as discussed below.
In a class diagram, for example, classes, interfaces, and packages are represented by GraphNodes, while associations, generalizations, and dependencies are represented by GraphEdges. These GraphNodes and GraphEdges have links to the related model elements of the UML metamodel. A class may contain multiple compartments. These are represented through nested nodes of the class node with a link to a SimpleSemanticModelElement, as compartments are not part of the UML metamodel, being only part of its representation. An attribute or operation is a nested node of the compartment node with a link to the corresponding attribute or operation of the UML metamodel. An attribute itself has attributes such as visibility and type. These parts of the attribute are represented by LeafElements. If an attribute part is represented as text, the subclass TextElement is employed, otherwise an Image or GraphicPrimitive is used.
The appearance of the end of an edge, e.g., the composite of an association end, generalization etc., is determined by the corresponding UML metamodel elements.
A special case is the n-ary association. It consists of a GraphNode representing the diamond which links the parts of the association. These parts again are shown as GraphEdges. Each of these is linked via a SemanticModelBridge to the same corresponding association. This means that several DiagramInterchange model elements (the GraphEdges) are utilized to visualize a single UML model element (the association). Figure 9 illustrates this mapping.
Other diagrams are represented similarly. The tool which makes use of this metamodel is responsible for the exact representation of elements which refer to semantic model elements. For example, the tool has to know that a node representing a class should be visualized through a rectangle. Its position, size, line style, etc. are determined by the elements of the metamodel.
An object in a sequence diagram is modeled as a GraphNode with a semantic model bridge to the corresponding instance. The height of this GraphNode is the entire height from the lifeline including the object at the top of the lifeline. The dashed lifeline is the only visible element of this GraphNode. The contained DiagramElements of the GraphNode are GraphNodes which represent the activated section of the lifeline. Such a GraphNode has a corresponding SimpleSemanticModelElement with the typeInfo active. Only one child of the top GraphNode has a corresponding SimpleSemanticModelElement with the typeInfo header to represent the rectangle at the top of the lifeline. The GraphNode with the TextElement is nested into this GraphNode. Another child of the top GraphNode can be a GraphNode to represent the cross at the end of a lifeline (see Figure 10). The cross is represented by a LeafElement. The arrows between the lifelines are GraphEdges with the stimulus as corresponding model element. The arrowhead of such a GraphEdge is not modeled explicitly, yet the type of the arrowhead can be found out through the corresponding action.
InteractionOccurrences can overlap multiple lifelines and other elements of sequence diagrams. To indicate that the elements below the InteractionOccurrence are visible through the InteractionOccurrence the Translucent property of the GraphNode of the InteractionOccurrence is set to true.