Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Sequence Diagrams #69

Open
SlavaVedernikov opened this issue Mar 20, 2024 · 0 comments
Open

Improve Sequence Diagrams #69

SlavaVedernikov opened this issue Mar 20, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@SlavaVedernikov
Copy link
Owner

SlavaVedernikov commented Mar 20, 2024

Context

  • Sequence diagrams for Business Processes have Group boxes per Activity as well as per cross-participant interactions. This make diagrams a bit too busy.
  • C4 Sequence Diagrams do not have participant at the bottom of the diagram (footer), which makes it difficult to read long diagrams.
  • Sequence diagrams have Group boxes per cross-participant interactions that display Interface Labels only. It's not clear from that which participant exactly is being called

Here is an example of the current PlantUML code for C4 Sequence diagram

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml

title Manage Accounts - C4 Sequence - Container level)

Person(TraderX.Actors.Trader, "Trader", "")

System_Boundary(TraderX.SoftwareSystems.TraderX, "TraderX")
    Container(TraderX.SoftwareSystems.TraderX.Containers.WebClient, "Web Client", "", "Browser based web interface for TraderX")
    Container(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Web GUI", "", "Allows employees to manage accounts and book trades")
    Container(TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Accounts Service", "", "Service which provides account management")
    Container(TraderX.SoftwareSystems.TraderX.Containers.PositionService, "Position Service", "", "Server process which processes trading activity and updates positions")
Boundary_End()

group Trader - View Account
Rel(TraderX.Actors.Trader, TraderX.SoftwareSystems.TraderX.Containers.WebClient, "View Account")
group View Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Load Account")
group Load Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Get Accounts")
end
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Load Trades For Account")
group Load Trades For Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.PositionService, "Get Trades For Account")
end
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Load Positions For Account")
group Load Positions For Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.PositionService, "Get Positions For Account")
end
end
end

group Trader - Create Account
Rel(TraderX.Actors.Trader, TraderX.SoftwareSystems.TraderX.Containers.WebClient, "Create Account")
group Create Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Create Account")
group Create Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Create Account")
end
end
end
group Trader - Update Account
Rel(TraderX.Actors.Trader, TraderX.SoftwareSystems.TraderX.Containers.WebClient, "Update Account")
group Update Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Update Account")
group Update Account
Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Update Account")
end
end
end

@enduml

...which renders as follows:

image

Requirements

  • Sequence diagrams for Business Processes must have Divider or separator per Activity.
  • C4 Sequence Diagrams must have participant at the bottom of the diagram (footer).
  • Group boxes per cross-participant interactions in Sequence diagrams must have the full Interface path like so: <Software System> - [<Container>] - [<Component>] -<Interface Label> e.g. TraderX - Web GUI - View Account

Here is an example of how PlantUML code for C4 Sequence diagram should look:

@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Sequence.puml

SHOW_FOOT_BOXES()

title Manage Accounts - C4 Sequence - Container level)

Person(TraderX.Actors.Trader, "Trader", "")

System_Boundary(TraderX.SoftwareSystems.TraderX, "TraderX")
    Container(TraderX.SoftwareSystems.TraderX.Containers.WebClient, "Web Client", "", "Browser based web interface for TraderX")
    Container(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Web GUI", "", "Allows employees to manage accounts and book trades")
    Container(TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Accounts Service", "", "Service which provides account management")
    Container(TraderX.SoftwareSystems.TraderX.Containers.PositionService, "Position Service", "", "Server process which processes trading activity and updates positions")
Boundary_End()

== Trader - View Account ==
Rel(TraderX.Actors.Trader, TraderX.SoftwareSystems.TraderX.Containers.WebClient, "View Account")
group TraderX - Web Client - View Account
    Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Load Account")
    group TraderX - Web GUI - Load Account
        Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Get Accounts")
    end
    Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Load Trades For Account")
    group TraderX - Web GUI - Load Trades For Account
        Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.PositionService, "Get Trades For Account")
    end
    Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Load Positions For Account")
    group TraderX - Web GUI - Load Positions For Account
        Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.PositionService, "Get Positions For Account")
    end
end

== Trader - Create Account ==
Rel(TraderX.Actors.Trader, TraderX.SoftwareSystems.TraderX.Containers.WebClient, "Create Account")
group TraderX - Web Client - Create Account
    Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Create Account")
    group TraderX - Web GUI - Create Account
        Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Create Account")
    end
end

== Trader - Update Account ==
Rel(TraderX.Actors.Trader, TraderX.SoftwareSystems.TraderX.Containers.WebClient, "Update Account")
group TraderX - Web Client - Update Account
    Rel(TraderX.SoftwareSystems.TraderX.Containers.WebClient, TraderX.SoftwareSystems.TraderX.Containers.WebGUI, "Update Account")
    group TraderX - Web GUI - Update Account
        Rel(TraderX.SoftwareSystems.TraderX.Containers.WebGUI, TraderX.SoftwareSystems.TraderX.Containers.AccountsService, "Update Account")
    end
end

@enduml

...which renders as follows:

image

@SlavaVedernikov SlavaVedernikov added enhancement New feature or request good first issue Good for newcomers labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant