Flowchart diagrams vs. UML activity diagrams [closed]
Asked Answered
P

5

49

What is the practical difference between using flowchart diagrams and UML activity diagrams? I have some thoughts, but maybe I'm missing an elephant in the room?

Flowchart diagram:

  1. Widely used;
  2. Easily understood by non-programmers;
  3. Old?

UML Activity diagram:

  1. Standardized;
  2. Supports concurrency;
  3. Less known syntax, but still simple enough.

For my case of ad-hoc documenting a particular block of application logic, I decided to go with the flowchart diagrams. More people in the company will be able to understand them.

Pasargadae answered 16/8, 2011 at 16:2 Comment(0)
O
26

It might seem as a preference, but if we have a standardized language for describing software systems, Why do we use something else? This can lead to bad habit of overusing flowcharts. Activity diagrams are really simple. But if you decide to describe a more complicated aspect of the system or try to change the part you are describing, you might have to switch anyway. So just use UML and prevent confusion in the future.

Oxygen answered 18/8, 2011 at 22:56 Comment(1)
assuming a standard is better because the standard says so, it is like that old while(1) infinite loop it is better not to enter. Activity diagram spreads confusion by its own name, there must be a reason why nobody understand them and ask similar questions.Edaphic
S
23

As you note, Activity diagrams inherently can include concurrency and timing. If you look at this example cribbed from Wikipedia, shown below, you can observe the section with two heavy horizontal bars, and two parallel activities of "present idea" and "record idea". That is read as "start these activities in parallel, and continue only when both are complete." Flowcharts can't express this within the notation.

Practically, using activity diagrams lets you think clearly about concurrent processes. I think you'll find that anyone who can read a flowchart will quickly adapt.

Activity diagram by ​spanish Wikipedia user Gwaur CC BY-SA 3.0, via Wikimedia Commons: ​Activity diagram from Wikipedia

Shortage answered 16/8, 2011 at 16:4 Comment(1)
Thanks, Charlie, I also mentioned that point in the original post. In my case, the logic is single-threaded, so both flowchart and activity diagram fit.Pasargadae
D
12

According to the Agile Modeling site:

In many ways UML activity diagrams are the object-oriented equivalent of flow charts and data flow diagrams (DFDs) from structured development.

From IBM:

However, flow charts do not include And states, and flow charts for operations cannot receive events.

Probably this is why flow charts are easier to understand because activity diagrams have the notion of object-oriented development and concurrency.

Derrek answered 22/1, 2012 at 11:29 Comment(0)
K
1

You can generate source code from UML, and vice versa; hence the "standardized" characteristic you talked about.

Kerril answered 16/8, 2011 at 16:5 Comment(2)
I believe this applies more to the class diagrams. I have also yet to find a decent roundtrip generator, that is able to rebuild the diagram when the code has changed.Pasargadae
@Vladimir Sinenko: if you can generate code implementing the logic of activity models, don't try to look for roundtriping - just change the activity model - you will avoid many problemsSplurge
F
1

UML in itself is used to share your understanding. Share the understanding in a standardized way. Since your case is ad hoc and the primary usage of an UML diagram is to provide an informal sketch, activity diagram can be used here. But so can flow charts as there are no parellism involved here. I have always found the following argument to be helpful. The artifct that i am producing is going to benefit whom? And can i express the flow in a self explanatory way using a flow chart. And if yes, then you should go ahead and use flow chart. But if your class diagrams, sequence etc are in UML format, it would make sense to have your activity diagrams in UML as well for consistency sake(The argument here would be, if people can understand class,sequence UML semantics, then y not activity diagrams.).

Forgat answered 18/8, 2011 at 5:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.