Mike Degteariov
Mike Degteariov

Reputation: 69

delegating and assembly connectors in UML2.0 component diagram

I am trying to understand how to create a UML2.0 compliant component diagram, and I found that different sources suggest different ways of how to show component’s internal structure - particularly, what kind of lines to use for delegating and assembling connectors.

I checked 4 different sources:

  1. “UML Distilled” book by Martin Fowler
  2. Section about component diagram on “Agile Modeling” web site, by Scott Amber
  3. Section about component diagram on IBM developer works web site - http://www.ibm.com/developerworks/rational/library/dec04/bell/index.html
  4. Section about component diagram on uml-diagrams

I found that these four resources draw connectors in different way:

For “delegating” connector:

  1. dashed line, open arrow
  2. solid line, open arrow, "delegate" stereotype
  3. solid line, open arrow, "delegate" stereotype
  4. solid line, no arrow

For “assembly” connector:

  1. solid line, no arrows, no annotation
  2. dashed line, open arrow
  3. ball and socket
  4. ball and socket

How come that four reputable sources explain standard diagram in such different ways ? Does anyone know if these connectors are standardized at all ? What does the standard say about it ?

Thanks !

Upvotes: 4

Views: 1200

Answers (1)

Ister
Ister

Reputation: 6318

Short answer

For delegating connector following notations are correct:

  1. Solid line connecting ports
  2. Solid line between interface in ball/socket notation and port

The specification doesn't give a clear answer about possibility of using arrows. Without arrows is correct for sure. With open arrows might be correct (see Long answer for details on that). There is nothing about the "delegate" stereotype, however stereotypes can be used more or less everywhere so I would consider it as acceptable but not mandatory.

Dashed line with open arrow shows any Dependency. Of course delegation is some kind of dependency but the notation wouldn't clearly show delegation. It can be a different type of Dependency as well then. So it should not be used unless you know what you're doing.

For assembling connector following notifications are correct:

  1. Solid line between classes
  2. Solid line between ports (also if interfaces are visible)
  3. Solid line between interfaces in ball/socket interface notation
  4. Ball/socket connector notation between simple ports
  5. Dashed line with open arrow (Dependency) between interfaces in ball/socket interface notation

For arrows on solid lines the same statement is true as in the delegation part.

Long answer (explanation/links)

I believe in such case it's best to reach to the most official source, that is the UML specification. The tricky thing is that the information is spread in many places. Below is the list where I found some mentions confirming the statements above:

11.2.4

A Connector is drawn using similar notation to that for Association (see 11.5.4).

additionally "When connecting simple Ports, normal Connector notation for assembly or delegation may be shown connected to the ball or socket symbol rather than to the Port symbol itself."

11.2.5 (Figure 11.4)

11.2.3.3

Connectors have a kind, whose value is assembly or delegation. The semantics of delegation connectors are only related to Ports and described under Port (see 11.3). All other Connectors are assembly connectors.

11.6.5 (Figure 11.47)(Figure 11.48)

As for arrows usage, the specification doesn't say anything explicitly about arrows usage for Connectors (and examples doesn't contain any arrows). However as arrows indicate navigable end of association and there is no such concept for Connectors I would assume there should be no arrows for Connectors. However as this is not explicitly forbidden and eventually the navigability could also considered for Connectors at least theoretically usage of arrows should be acceptable.

Upvotes: 1

Related Questions