UML Course

Multiplicity

Go back

Since the relationship between two classes is defined by an association, we are simply adding the multiplicity's value to it.

Multiplicity

You should read here that

  • m is a value representing the number of instances of the class A interacting with an object of the class B
  • n is a value representing the number of instances of the class B interacting with an object of the class A

And, yeah, the number is on the opposite side.


Notice that the value is at the opposite side. The values that we can use are

  • n: exactly n, this is a number like 0,1,2,...
  • *: 0 or more
  • 0..1: 0 or 1
  • 0..*: same as *
  • 1..*: 1 or more
  • n..*: n or more
  • n..m: at least n, and up to m
  • n..n: same as n

For instance, in the example above with n..m, we could replace our n by 0..1 (0 or 1) and our m by * (0 or more).