Structural, Behavioral, and Flow Diagrams: Definitions, Examples, and Visualization Code
Jifeng Wu
6.3k words 53 mins
Structural, Behavioral, and Flow Diagrams: Definitions, Examples, and Visualization Code
Structural Diagrams
Structural diagrams show the structure or organization of an entity - how components are arranged and related - rather than events or interactions.
Mind Map
A mind map is a hierarchical diagram that visually organizes ideas, tasks, or concepts, typically radiating from a central theme.
PlantUML
1 2 3 4 5 6 7 8 9 10 11 12 13 14
@startmindmap * Debian ** Ubuntu *** Linux Mint *** Kubuntu *** Lubuntu *** KDE Neon ** LMDE ** SolydXK ** SteamOS ** Raspbian with a very long name *** OSMC *** Volumio @endmindmap
Debian
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
@startmindmap + OS ++ Ubuntu +++ Linux Mint +++ Kubuntu +++ Lubuntu +++ KDE Neon ++ LMDE ++ SolydXK ++ SteamOS ++ Raspbian -- Windows 95 -- Windows 98 -- Windows NT --- Windows 8 --- Windows 10 @endmindmap
OS
Work Breakdown Structure Diagram
A work breakdown structure diagram breaks down a goal or project into manageable parts or tasks in a hierarchical structure, making it easier to see how work is organized.
PlantUML
1 2 3 4 5 6 7 8 9 10 11 12 13
@startwbs * Business Process Modelling WBS ** Launch the project *** Complete Stakeholder Research *** Initial Implementation Plan ** Design phase *** Model of AsIs Processes Completed **** Model of AsIs Processes Completed1 **** Model of AsIs Processes Completed2 *** Measure AsIs performance metrics *** Identify Quick Wins ** Complete innovate phase @endwbs
@startyaml doe: "a deer, a female deer" ray: "a drop of golden sun" pi: 3.14159 xmas: true french-hens: 3 calling-birds: - huey - dewey - louie - fred xmas-fifth-day: calling-birds: four french-hens: 3 golden-rings: 5 partridges: count: 1 location: "a pear tree" turtle-doves: two @endyaml
doe: "a deer, a female deer"
Network Diagram
PlantUML
A diagram that shows the layout and connections between components or entities in a network, such as devices or organizational units.
Behavioral diagrams illustrate the dynamic aspects of entities - how they operates and changes over time. These diagrams focus on state changes, activities, workflows and communication.
State Diagram
Illustrates the different states an entity can be in, and the transitions between them in response to events.
Mermaid
1 2 3 4 5 6 7 8
stateDiagram-v2 [*] --> Still Still --> [*]
Still --> Moving Moving --> Still Moving --> Crash Crash --> [*]
stateDiagram-v2
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
1 2 3 4 5 6 7 8
stateDiagram-v2 [*] --> Active
state Active { [*] --> CapsLockOff CapsLockOff --> CapsLockOn : CapsLockPressed CapsLockOn --> CapsLockOff : CapsLockPressed }
stateDiagram-v2
[*] --> Active
state Active {
[*] --> CapsLockOff
CapsLockOff --> CapsLockOn : CapsLockPressed
CapsLockOn --> CapsLockOff : CapsLockPressed
}
state NewValuePreview { State1 --> State2 } } @enduml
NotShooting, Configuring
Sequence Diagram
Shows the interactions between different entities over time, emphasizing order and timing.
Mermaid:
1 2 3 4
sequenceDiagram Alice ->> John: Hello John, how are you? John -->> Alice: Great! Alice ->> John: See you later!
sequenceDiagram
Alice ->> John: Hello John, how are you?
John -->> Alice: Great!
Alice ->> John: See you later!
PlantUML:
1 2 3 4 5 6
@startuml Alice -> Bob: Authentication Request Bob --> Alice: Authentication Response Alice -> Bob: Another authentication Request Bob --> Alice: Another authentication Response @enduml
Alice, Bob
Flow Chart / Flow Diagram / Activity Diagram
Charts the step-by-step actions and decisions in a process, clarifying how things progress from start to finish.
Mermaid
1 2 3
flowchart LR First -- First to Second --> Second Second -- Second to Third --> Third
flowchart LR
First -- First to Second --> Second
Second -- Second to Third --> Third
1 2 3 4 5 6
flowchart TD Start --> Is_it[Is it?] Is_it -- Yes --> OK OK --> Rethink Rethink --> Is_it Is_it -- No --> End
flowchart TD
Start --> Is_it[Is it?]
Is_it -- Yes --> OK
OK --> Rethink
Rethink --> Is_it
Is_it -- No --> End
PlantUML
1 2 3 4 5 6
@startuml start :Text 1; :Text 2; stop @enduml
Text 1, Text 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
@startuml start if (condition A) then (yes) :Text 1; (no) elseif (condition B) then (yes) :Text 2; (no) elseif (condition C) then (yes) :Text 3; (no) elseif (condition D) then (yes) :Text 4; else (no) :Text 5; endif stop @enduml
if-elseif-else-endif
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
@startuml start switch (test?) case ( condition A ) :Text 1; case ( condition B ) :Text 2; case ( condition C ) :Text 3; case ( condition D ) :Text 4; case ( condition E ) :Text 5; endswitch stop @enduml
switch-case-endswitch
1 2 3 4 5 6 7 8
@startuml start while (data available?) is (yes) :read data; :generate diagrams; endwhile (no) stop @enduml
while-endwhile
1 2 3 4 5 6 7 8
@startuml start repeat :read data; :generate diagrams; repeat while (more data?) is (yes) not (no) stop @enduml
repeat-repeat while
1 2 3 4 5 6 7 8 9
@startuml start fork :action 1; fork again :action 2; end fork stop @enduml