Reputation:
Can someone please explain to me what do the highlighted elements mean in a snapshot of a UML class diagram shown below:
The image above has been taken from the UML specifications at http://www.omg.org/spec/UML/
on further reading I found
The curly braces are called "adornments", which in this case have been placed on relationship. In this case they have been used to place constraints on the elements that are part of the relationship.
Still no clue about the + symbol.
Upvotes: 4
Views: 1520
Reputation: 36305
Adornments are everything added to the connectors, namely text labels. The curly brackets are constraints. These can be either plain text or OCL. The subsets
is a keyword within UML. P. 17 of the UML spec says
Association Ends: each specified by its name, type, and multiplicity, any additional properties such as {union}, and a link to its opposite end. If the association end subsets or redefines others, this is shown in the additional properties as {subsets } or {redefines }, where is a link to the applicable end. This is followed by a textual description of the purpose and meaning of the association end. If an association end is derived, the name will be preceded by a forward slash. If the association end is a composition, this is indicated by a small black diamond adjacent to the name of the end.
The plus says the attribute (which the role name ownedTemplateSignature
is) has public visibility. P. 60 of the specs:
- public A Named Element with public visibility is visible to all elements that can access the contents of the Namespace that owns it.
- private A NamedElement with private visibility is only visible inside the Namespace that owns it.
- protected A NamedElement with protected visibility is visible to Elements that have a generalization relationship to the Namespace that owns it.
- package A NamedElement with package visibility is visible to all Elements within the nearest enclosing Package (given that other owning Elements have proper visibility). Outside the nearest enclosing Package, a NamedElement marked as having package visibility is not visible. Only NamedElements that are not owned by Packages can be marked as having package visibility.
And on p. 111:
<visibility> is the visibility of the Property. (See VisibilityKind - sub clause 7.4.) <visibility> ::= ‘+’ | ‘-‘ | ‘#’ | ‘~’
(in the order of the list above, e.g. '+' is public)
And to extend as suggested by @granier, the little dot (which had been introduced with 2.1.1) at the end of the associations has this meaning: (p. 200)
Ownership of Association ends by an associated Classifier may be indicated graphically by a small filled circle, which for brevity we will term a dot. The dot is to be drawn integral to the graphic path of the line, at the point where it meets the Classifier, inserted between the end of the line and the side of the node representing the Classifier. The diameter of the dot shall not exceed half the height of the aggregation diamond, and shall be larger than the width of the line. This avoids visual confusion with the filled diamond notation while ensuring that it can be distinguished from the line. The dot shows that the model includes a Property of the type represented by the Classifier touched by the dot. This Property is owned by the Classifier at the other end. In such a case it is normal to suppress the Property from the attributes compartment of the owning Classifier.
Actually the whole page is talking about ownership and navigability. But basically the dot means that the class at the opposite end owns the relation which means it can navigate towards the dotted class. Dots at either side mean that both classes know of each other.
Upvotes: 4