Meaning of some notations in class diagram doc

0 votes
asked Mar 13, 2023 in Question / help by rayx
In the "relations between classes" section of class diagram documentation page (, there is an example containing these notations. I don't use UML a lot, but they don't seem like valid UML notations for class relations to me. I wonder what are they used for? Thanks.

Class21 #-- Class22
Class23 x-- Class24
Class25 }-- Class26
Class27 +-- Class28

1 Answer

+1 vote
answered Mar 14, 2023 by Todd Musheno (2,680 points)
Best answer
This is very common in uml, but you are correct, it is not a part of the rational/omg specification (great place to learn the basics, but the spec is only a starting point IMHO).

UML predates standards (originally it was done on cocktail napkins, with swizzle sticks, and plastic olive swords, etc...)

Common usages in the wild:

A #-- B: a back reference (the useful relationship is A to B, but is held in B, not A)

A x-- B: a non relationship... IE: B is not related to A. Common where a relationship occurs in parent classes, but are not useful in certain children

A }-- B: See entity relationship diagrams (there are more relation endings listed there)

A +-- B: Required relationship (IE: non-null) If you look at Deployment Diagrams... A o-- B is commonly used to denote optional relationships (technically no end marker does not denote optinality, but this is rather pedantic, so this kind of thing is uncommon in the wild).

Listed, but not a part of UML proper:

A <-- B: directional relationship (IE: B is related to A, but A is not related to B).
commented Mar 14, 2023 by rayx
Hi Todd, thanks for the detailed explanation. That's a lot to digest :D I doubt if I would ever be able to figure it out myself without your help (I googled but had no idea what's the proper keywords for them). Thanks!