Reputation: 69
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:
I found that these four resources draw connectors in different way:
For “delegating” connector:
For “assembly” connector:
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
Reputation: 6318
For delegating connector following notations are correct:
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:
For arrows on solid lines the same statement is true as in the delegation part.
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