UML for multithreading dataflow
Asked Answered
F

6

5

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.

Fadiman answered 14/6, 2011 at 14:53 Comment(0)
B
6

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.

Brooke answered 14/6, 2011 at 15:2 Comment(0)
W
5

Sequence diagrams do have notation for both parallel operations and asynchronous calls and would be an appropriate means of showing your dataflow.

enter image description here

enter image description here

Welladvised answered 14/6, 2011 at 15:15 Comment(2)
Nice! This reminded me of this awesome site I used to make a similar diagramSmocking
Got to add to the love for WSD as wellPreprandial
P
3

Depends on the problem, but I'd probably go with an activity diagram to describe the sequence of events: http://www.agilemodeling.com/style/activityDiagram.htm

Then maybe a set of sequence diagrams to capture the class-level interactions for each of those steps.

Alternatively, you could look at describing the sequence serially (think iterating an array in a loop) and just note that the iteration should be parallelised in implementation.

Preprandial answered 14/6, 2011 at 15:2 Comment(0)
E
0

To show multithreading you can use different colors to show.

For ex red to show one thread and blue color to show different thread

Envelopment answered 18/4, 2012 at 9:5 Comment(1)
Non-standard but visually can be very descriptive.Kitchenmaid
S
0

If you want to visualize multiple threads' states (like many profilers do), take a look at PlantUML timing diagrams. It isn't ideal tool for showing many inter-thread communications but suits well for showing transitions between threads' states: Timing diagram example by Adam Rosien

Slovenia answered 14/2, 2020 at 10:34 Comment(0)
I
0

I would tell you something more radical, yes I agree Activity Diagrams are really useful to represent parallel flow but in my opinion State Machines and their diagrams are the ultimate tool to deal with parallel/multi-threaded workflows.

Practically every State Machine you model in Diagrams represents the prallelity and their Events, theirs interaction points.

Please look into this diagram from my Blog. AS you can see Credit State Machine, Credit Score State Machine, Address Check State Machine and Fraud Prevention State Machine, they all work in parallel for Business Case with the help of Apache Kafka.

Innervate answered 18/7, 2022 at 5:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.