Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show multiplicities in UML object diagrams

I wonder if there is way to create an array of objects in UML?

the following is my try using Modelio as a modeling environment but as you can see there is different objects(i.e. instance[0],instance 1],instance[2],instance[3])

enter image description here

like image 704
Andrew Avatar asked Feb 22 '13 20:02

Andrew


People also ask

How do you represent multiplicity?

Multiplicity is represented as a number and a * is used to represent a multiplicity of many.

What is multiplicity in object model?

The number of instances of a class that can be linked by a particular association to a single instance of the class at the other end of the association is known as the multiplicity of the association at the end.

What is UML multiplicities?

In UML, multiplicity describes how many instances of one class can be connected to an instance of another class through a given association. This relation is often expressed as a string showing the lower and upper bounds at the endpoints of a connection.


1 Answers

As you know there are two ways to show UML attributes in class diagrams: attribute text and association notation.

Consider an example of a company and employees. Two valid class diagrams are:

enter image description here

Now let's try to draw the corresponding object diagrams:

If the details of the fulltime_employees like age are important, there is no other way but to show them as separate objects:

enter image description here

If details are not important, we could go with attribute text notation:

enter image description here

Another way of showing it when number of objects is more (let's say 5 here): (This is also the general way to show multiplicities in object diagrams)

enter image description here

Hope it helps.

like image 64
jurgenreza Avatar answered Oct 13 '22 09:10

jurgenreza