Prev Next

Connectors

Work with connectors

Relationships in any context can be hard to understand, and relationships between model elements are no exception. In modeling, the elements are only part of the model; relationships are like a glue that binds the elements together or, making a comparison with natural languages, if the elements are nouns the relationships are verbs that describe how the nouns relate to each other.

Relationships are represented in modeling diagrams by different types of line, or connector, each line indicating the kind of relationship and interaction there is between the elements. The connector types are defined by the modeling languages or profiles they belong to. For example, Associations and Generalizations are part of the grammar of UML; Sequence Flows and Message Flows are part of the grammar of BPMN; and Allocates and Item Flows are part of the grammar of SysML. Each connector type has a notation that helps modelers recognize the connector and understand its purpose; the types also inform tools such as the Code Templates Framework how to generate resulting models, schemas or programming code.

There are many different types and styles of connectors. They can have arrows (indicating direction) or other markers that express the semantics of the relationship; they can have names, stereotypes and Tagged Values, and a wide range of other properties. Some connectors are like conduits that allow material and tokens to flow; some are about family, others tell an element to change its state, while still more are about signals and structure. It is important to remember that a diagram is just a projection (or view) of an underlying model and just because a connector isn't visible on the diagram it doesn't mean that it doesn't exist. Perhaps the best way to think about a diagram is as a narrative or story that is trying to reveal a plot to an audience. The connectors play an important role in this story telling, and hiding them or leaving them out is sometimes as important as putting them in.

Connectors can also 'reach' inside the perimeter of the element and be attached to an element's features (attributes, operations and receptions). This is particularly useful when doing data matching, for example, between two different data sources.

There are a number of places where you can review connectors in Enterprise Architect - other than in diagrams - including the Traceability window, the simple Feature and Gap matrixes, the Relationships Window, the Hierarchy Window, the Relationship Matrix, the 'Details' tab of the Inspector window and the 'Properties' dialog for an element. They are, however, most expressive in diagrams, where their characteristics and properties are easily observable.

Factors in Modeling Connectors

Operation

Discussion

See also

Routing and Bending

Connector lines require geometry to be able to navigate around the elements on the diagram as they emerge from one element and connect to another. Thoughtful placement of related elements can limit the need to route connectors, but it is often the case that connectors have to be bent and directed. Some line styles - such as the Auto Routing style - can manage  this automatically, but using the Custom Style is the most flexible method, allowing any number of way-points to be added to a connector, at each of which the line can be bent to direct it in a complex path through the diagram. The Diagram Layout tool also provides ways of automatically laying out a diagram to organize it neatly with a minimum of crossed lines. When lines do have to cross you can select an option to add jump symbols to reduce the ambiguity of the line direction.

Layout Diagrams Connector Styles Diagram Options

Changing Style

Connectors have default line styles that you can change to create more appealing and meaningful representations of the relationships; for example, a relationship of family can be represented by a Tree style. This shows the parent element at the top and the child elements in a row underneath (or in a column to the side) with the connectors between each child and the parent having a common 'trunk' at the parent, in a tree format. The same relationships could also be viewed as a collected set in an Orthogonal or Lateral style. All connectors of a similar type can be conveniently changed to the same type on a diagram. Other line styles, such as Auto Routing, will themselves change the bends in a connector as an attached element is moved in the diagram. The Custom style is the most flexible, allowing you to bend the connector at any point to create any number of way points and route the connector around the diagram layout. 

Connector Style Options

Using Color and Line Thickness

The color and thickness of lines can be changed to create meaning and appeal in diagrams. These changes are local to the selected connector(s) on any diagram, but using the style picker and painter of - for example - the Layout ribbon you can apply the selected line style to multiple connectors. While the tool offers great flexibility to assign styles manually, it is worth considering the use of Diagram Legends, which can automatically change the style of the connectors (and also elements) based on connector metadata such as the connector's stereotype.

Connector labels can also be changed at a granular level. Each label reflects a property of the connector, although you can also edit the text in a label. You can hide or show the labels, change their text color and bold them, add direction arrows, display the text horizontally or vertically, and return the moved label to its original position.

Connector Appearance Options Diagram Legends Style Panel Manage Object Labels

Connector Direction and Ends

In our natural languages verbs have direction; for example 'The cat likes Juliet.' is not the same as 'Juliet likes the cat.' So too with connectors, direction often reveals important semantics, and the ends of the connector can be labeled with a variety of markers that express the details of the meaning. It easy to make mistakes when creating diagrams, and to draw the connectors in the wrong direction. Fortunately there are some powerful features for working with connector direction, including being able to reverse the direction of a connector without the need to recreate it. Connector ends can also be pinned so that the connector stays bound to its attachment point on the connected element.

Connector Style Options Source and Target Role Reverse Connector

Showing and Hiding Connectors

As mentioned earlier, a diagram is a narrative and the choice to include, show, hide or remove connectors is an important decision in telling the right story. When elements are placed on a diagram Enterprise Architect will, by default, add the existing connectors (remembering that elements can have reflexive connectors). A modeler can choose a variety of options to either completely hide specific connectors in this diagram and/or other diagrams, hide all the labels, or selectively hide parts of the labels such as role names and multiplicities. Hiding parts of the labels can be a useful option when presenting to non-technical audiences, who tend to be distracted by all the detail. Connectors that have been hidden can easily be made visible again from the 'Diagram' panel of the 'Layout' ribbon. You can also 'freeze' a diagram so that it shows all the connectors you require at that point, but will not update with any other connectors subsequently created between the elements.

Freeze Visible Connectors Relationship Visibility Delete Connectors Hide/Show Connectors

Types and Markers

Enterprise Architect is a standards-based tool, and many of the diagrams and their constituent elements and connectors are intentionally defined as part of a standard. Thus a Business Process diagram will contain Activities and Tasks sequenced with Control Flow connectors, and a Domain diagram will have Associations to express structural relationships such as whole-part. The modeler is thus aided and at the same time straight-jacketed by what the chosen modeling language defines as the allowable connectors. We of course face the same thing in our natural languages, where we must choose the right form of a verb or the meaning of the sentence will be lost. So in English  'Jonathon went fishing with Wendy' is a good sentence, but 'Jonathon went Wendy with fishing' is not. So too with the connectors, which have markers, labels and annotations that must be used to express meaning in the models. For example, a Composite Association in the Unified Modeling Language has a solid black marker at the whole end of the relationship with an important multiplicity label at the other. If you reverse the direction, the meaning of the 'sentence' will be changed.

UML Connectors UML Diagrams

Learn more