Search code examples
javaumlclass-diagramsequence-diagramdataflow

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.


Solution

  • 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.