Connectors in structured classifiers

In UML diagrams, a connector is a line that represents a relationship in a model. When you model the internal structure of a classifier, you can use a connector to indicate a link between two or more instances of a part or a port. The connector defines the relationship between the objects or instances that are bound to roles in the same structured classifier and it identifies the communication between those roles.

As the following figure illustrates, you can add a connector between two or more parts in a structured classifier.

A diagram frame with the heading
Car shows two rectangles rear:Wheel[2] and e:Engine, which each represent
a part of the containing classifier Car. The two parts are connected by a
straight line labelled rearaxle.

In the above example, the class Car contains two internal composite parts: rear:Wheel[2], which represents the two rear wheels of a car, and e:Engine, which represents the engine of the car. The rearaxle connector links the engine of the car to the instances in the set rear:Wheel.

As the following figure illustrates, you can add a connector from a part to a port to link instances of one class to instances of a different class.

A diagram frame with the heading
Boat, shows two rectangles :Propeller and e:Engine, which each represent a
part of the containing classifier Boat. The :Propeller part is connected to
a port on the e:Engine part by a straight line labelled shaft.

In the above example, the class named Boat contains a part named :Propeller, which is connected by the shaft connector to the port of e:Engine. Although the part e:Engine has the same type name in both the Car and Boat classes, the parts are different instances and each belong to a different containing classifier.

In structured classifiers, you can create two types of connectors:

You can use both types of connectors in one containing classifier to describe the various communication links between the parts.

As the following figure illustrates, you can connect two internal parts that represent the front and rear wheels with an assembly connector, and you can also connect the internal part front:Wheel[2] to the external port of :Engine with a delegate connector.

A diagram frame with the heading
Car contains one external port and two connected parts. The front:Wheel[2]
part is connected by a straight line with an open arrowhead that points toward
a port on the external border of the diagram. The connector is labelled delegate.
The two internal parts are connected with a straight line, which is labelled
assembly.
Related concepts
Connectors
Related tasks
Adding parts to composite structure diagrams
Connecting parts and ports in composite structure diagrams
Connecting modeling diagram elements
Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.