Skip to content
holzkohlengrill edited this page Dec 15, 2023 · 18 revisions

UML

Diagram types and short description of each:

Class diagram

Class diagrams and common meanings in programming

Type Relation Implementation UML
Association knows a Contains a pointer or reference to another object.
Undirected usually means: It has not been decided whether the association is directed or the association is bidirectional (can call each other).
Dependency uses (temporarily) a The independent class is a parameter variable or a local variable of a method of the dependent class.
Aggregation has a A class is a collection or container of other classes. The contained classes do not have a strong life cycle dependency on the container(-class) -> if the container is destroyed, its contents are not.
is entirely made of Association differs from aggregation only in that it does not imply any containment.
Composition has a = stronger form of aggregation. If the container is destroyed, its contents are also destroyed.
Inheritance is a A class is derived from another class.
Class template is a Template classes mean generic classes.


  • void return type can be omitted
  • Arrows are sometimes optional like in aggregation, composition, ...
    • The worded relation refers to the direction the arrow would go (A --> B; A knows a B)
  • Relationship grouping
    • Association
      • Dependency
      • Aggregation
      • Composition
    • Generalisation
      • Inheritance
      • Template class
      • Interface

Multiplicity


  • multiplicity
    • *: 0, 1, or more
    • 1: exactly this number
    • 4..8: range (inclusive)
    • 5..*: range (5 or more)

Activity diagram

Object (here: BrokenPencil) of a certain class (here: Junk):

See BrokenPencil as an instance of Junk.

Loops

Possibilities via:

  1. decision node
  2. loop block

Decision nodes and guards

Further Reading

Clone this wiki locally