简体   繁体   中英

How can I show, that a method is synchronized in class diagram (UML)?

I have created a class in java with a public static synchronized method.

How can I show that the public method (+) is synchronized in a class diagram?

Edit: I want to show this in the class diagram, that is important, No need for activity diagram. only CLASS diagram...

UML cannot handle synchronized by default, however, you can use stereotypes, this best described in this Visualizing the synchronization of Java-threads with UML paper with examples.

You may not be able to do this with class diagrams, but, you can do it with sequence diagrams.

在此处输入图像描述

You can try a user-defined notation with adding a note. Note for synchronized methods Example for synchronzed method

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM