1

I have this attribute in Java:

private final Object MUTEX = new Object();

How can I show the init of a new Object in the UML Class Diagram?

EDIT:

The attribute MUTEX is used only for synchronized (MUTEX) operation. So I was wondering if the initialization of this variables is needed to be specified in a UML class diagram, but i'm not sure if this initialization is behavior like or structural specific.

Simone
  • 425
  • 1
  • 6
  • 17

1 Answers1

2

A class diagram is meant to show structure. As a part of structure you can show initial values of properties as answered in this question.

To show the operation "in progress" you need to create a Sequence Diagram where you can show behavior. The question would be: why? A simple initialization is usually not worth it. And from the skinny context of your question it does not appear to be the case. So the best is to go with above answer.

Edit (past your question edit) This is just structure and you will show it like this:

enter image description here

qwerty_so
  • 35,448
  • 8
  • 62
  • 86