Flowchart or Sequence diagram to describe a process?
Asked Answered
I

2

5

Say I what to describe a login process, which involves some steps. Although each step may be an asynchronous interaction, e.g. a http request & response, the overall steps happen in a sequential order.

It seems that both flowchart and sequence diagram can do the job. Which one is more appropriate for what situation? I am not referring to UML diagram but flowchart and sequence diagram in general sense.

Now I only have a simple rule that if I several branching logics, flowchart seems more appropriate because it is more straightforward then. But for login process the branching logics are simple, e.g., a. if account doesn't exist, jump to the register process; b. if account/password don't match, allow users to reset password then login again; c. after log in, based on the account preference presenting the user with different page.

So if the branching logic is simple, is it just a preference or there are other rules to apply?

Ictus answered 29/3, 2022 at 7:57 Comment(2)
by flowchart, do you mean lucidchart.com/pages/business-process-mapping or lucidchart.com/pages/data-flow-diagramIlianailine
Man, I had thought flowchart was the mostly common understood chart. I didn't know there was a such difference. For my question I just want to emphasize that I was NOT talking about UML diagram.Ictus
S
7

As you have already pointed out in your question, both diagrams are suitable for describing a sequence of operations or activities.

It really depends on what aspect of the system you want to show:

A sequence diagram is appropriate for showing the interaction between two or more objects. This typically involves some request and response messages and possibly their parameters.

In contrast, a flowchart is appropriate for showing the control flow for one process, focusing on things like decisions (if-then-else) and parallel processing (forking).

So for your login process example, if you need to describe the sequence of messages between for example a client and a server process and a data base, you should use a sequence diagram. If however you need to describe the system's behavior as experienced by the user and without showing the interactions with other components, you should probably use a flowchart.

Stare answered 1/4, 2022 at 10:10 Comment(0)
I
3

After raising this question for more than 1 year now I have a preference for sequence diagram over flowchart for most of high level design documents. Because in HLD I mostly want to show key components in my design and the interaction between them (who does what). If there is some branching logic in the interaction I can add note in it.

Let me quote this sequence diagram from the article "Single page application: from monolithic to modular" (I also highly recommend this article to someone who is interested in SPA). So the control flow shows in words and a loopback arrow.

I see some people may call it swimlane flowchart or cross-functional flowchart. But without a free tool and proper version control, I have to stick with the sequence diagram(and use mermaid). BTW, mermaid has an open issue for swimlane

enter image description here

Ictus answered 12/10, 2023 at 4:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.