19

I am about to draw/document for some client-server connection establishing code to better understand it. There are several operations that are done asynchronously in separate threads (connecting threads, data receiving threads, etc).

Should I show them on separate diagrams? I would prefer to have it on a single diagram to grasp overall view but don't know how to represent it on Activity diagram.

Marcin Gil
  • 68,043
  • 8
  • 59
  • 60

2 Answers2

20

I'm not sure if there's a correct way of doing this, I developed my own method by testing different strategies until I came up with something that worked for my own mindset.

This is how I do it:

  • Threads == Swimlanes
  • Thread Operations == Action/Activity nodes
  • Critical sections == Object nodes
  • Thread creation == Fork nodes
Zoe
  • 27,060
  • 21
  • 118
  • 148
sharkin
  • 12,162
  • 24
  • 86
  • 122
  • And this is exactly how I did this :) – Marcin Gil Jan 30 '09 at 20:02
  • Excellent dude, i've been looking for something like this. – scope_creep Jun 30 '10 at 13:19
  • 1
    I think anyone who sits with an activity diagram for a few hours messing around, eventually comes up with something like this. For my own part however I'm still looking for some dedicated diagram format for concurrency. Doing it with activity diagrams works reasonably well on small components, but larger systems look like spaghetti, zero readability, even for the author. – sharkin Feb 17 '11 at 17:24
  • @sharkin: you could look at gateways defined by http://www.bpmn.org . I am looking for the exact same thing, BPMN gateways look like a possible solution for depicting this. You can read more at: http://tynerblain.com/blog/2006/07/18/foundation-series-business-process-modeling/ and specifically for concurrent/async processes: http://tynerblain.com/blog/2007/11/19/asynchronous-processes/ – Cohen Jul 20 '12 at 10:58
  • 9
    Could you update the example image? It is showing broken image. – Rosdi Kasim Mar 26 '14 at 09:35
  • 1
    @sharkin, do you still have a copy of that image? The link is broken. – user994165 Oct 19 '16 at 16:12
  • @sharkin how do you rapresent data that arrives like messages as mqtt one or ble? I need to rapresent a model that does something when a ble message arrives. But it can receive that only if user press start button – Sam Jul 20 '21 at 13:51
6

Instead of using full arrowheads you can use half arrowheads to show an asynchronous message call. As shown

alt text

Spooky
  • 2,966
  • 8
  • 27
  • 41
Raminder
  • 1,847
  • 2
  • 18
  • 30
  • 11
    This is sequence diagram - not activity diagram. I would like to have overall actions instead of specific function calls to see what's going on. – Marcin Gil Jan 06 '09 at 11:12