Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UML for multithreading dataflow

I want to paint a diagram where you can see the dataflow of a java program, and if there are one or multiple threads handling the data.

Sequence charts don't show multithreading and get very confusion when you have more than 5 different entities.

Class diagrams are good for showing the relations but the dataflow is missing.

I would like to paint boxes (like class/package diagram) and connect them. Maybe having a box doubled and ... in between to show that there can be more than one thread.

What diagram does UML have for this kind of dataflow diagram?

What editor is good for that diagram? If possible freeware or open source.

like image 564
Franz Kafka Avatar asked Jun 14 '11 14:06

Franz Kafka


People also ask

How do you show multiple threads in a sequence diagram?

You can use a "par" fragment to model multiple synchronous calls being executed in parallel. The fragment consists of a rectangle with the label "par". The rectangle is divided into multiple boxes, each representing a thread of execution.

How do you represent a thread in UML?

Activity, Sequence, and State Diagrams are all correct ways of showing thread behavior. 1st: (To vs's comments) There are two sets of diagrams or modeling elements in UML, static structure, as you put it, and behavioral.


1 Answers

I would look at athe UML activity diagram for showing multiple threads and their parallel execution. On communication diagrams, you also sometimes see thread letters (e.g. A,B,C) to try and denote concurrent threads, but I almost always find this confusing. There are fragments in UML 2 which may help show concurrency in sequence diagrams, but I always find this cumbersome and the diagrams hard to refactor (which means they quickly go out of date).

If the threads are executing the same tasks, but running in parallel, you could just add a Note to your diagram to explain this. This way you could concentrate on modelling a single thread accurately and cleanly.

With regard to which tool to use most IDEs will have some degree of UML modelling tool included e.g. I am happy to use the EMF based tools which ship with Eclipse.

like image 180
planetjones Avatar answered Sep 20 '22 04:09

planetjones