Skip to content

Conversation

@kirchsth
Copy link
Member

@kirchsth kirchsth commented May 1, 2021

With the new layout macro SHOW_PERSON_OUTLINE() (and PlantUML version >= v1.2021.4) persons can be displayed with the new PlantUML person shape like below (can be tested via my extended branch).

Using SHOW_PERSON_OUTLINE()

This call requires PlantUML version >= v1.2021.4!

@startuml SHOW_PERSON_OUTLINE() Sample
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml

SHOW_PERSON_OUTLINE()

Person(admin, "Administrator")
System_Boundary(c1, 'Sample') {
    Container(web_app, "Web Application", "C#, ASP.NET Core 2.1 MVC", "Allows users to compare multiple Twitter timelines")
}
System(twitter, "Twitter")

' if a person is combined with a sprite then the rectangle layout is used again
Person(person, "Person with sprite", $sprite="person2")

Rel(admin, web_app, "Uses", "HTTPS")
Rel(web_app, twitter, "Gets tweets from", "HTTPS")
@enduml

SHOW_PERSON_OUTLINE() Sample

techn. details: the new source can be used with old PlantUML versions too (as long the new macro is not called)

BR Helmut

source of second image:

@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
SHOW_PERSON_OUTLINE()

Person(customer, Customer, "A customer of the bank, with personal bank accounts")

System_Boundary(c1, "Internet Banking") {
    Container(web_app, "Web Application", "Java, Spring MVC", "Delivers the static content and the Internet banking SPA")
    Container(spa, "Single-Page App", "JavaScript, Angular", "Provides all the Internet banking functionality to cutomers via their web browser")
    Container(mobile_app, "Mobile App", "C#, Xamarin", "Provides a limited subset of the Internet banking functionality to customers via their mobile device")
    ContainerDb(database, "Database", "SQL Database", "Stores user registration information, hashed auth credentials, access logs, etc.")
    Container(backend_api, "API Application", "Java, Docker Container", "Provides Internet banking functionality via API")
}

System_Ext(email_system, "E-Mail System", "The internal Microsoft Exchange system")
System_Ext(banking_system, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

Rel(customer, web_app, "Uses", "HTTPS")
Rel(customer, spa, "Uses", "HTTPS")
Rel(customer, mobile_app, "Uses")

Rel_Neighbor(web_app, spa, "Delivers")
Rel(spa, backend_api, "Uses", "async, JSON/HTTPS")
Rel(mobile_app, backend_api, "Uses", "async, JSON/HTTPS")
Rel_Back_Neighbor(database, backend_api, "Reads from and writes to", "sync, JDBC")

Rel_Back(customer, email_system, "Sends e-mails to")
Rel_Back(email_system, backend_api, "Sends e-mails using", "sync, SMTP")
Rel_Neighbor(backend_api, banking_system, "Uses", "sync/async, XML/HTTPS")

SHOW_LEGEND()
@enduml

kirchsth added 8 commits April 8, 2021 17:42
…nIconic and tags (7 - update sample with scaled sprites)

plantuml-stdlib#49,  plantuml-stdlib#139: Persons can be displayed as portraits - SHOW_PERSON_PORTRAIT()
…() and Lay_Distance() (instead of SHOW_LEGEND_UP(), ..._DOWN(), ..._LEFT(), ..._RIGHT())
…() and Lay_Distance() (3 - legend is reserved; LEGEND() is new default alias)
@Potherca Potherca added this to the v2.3.0 milestone May 2, 2021
@Potherca Potherca linked an issue May 2, 2021 that may be closed by this pull request
@kirchsth kirchsth mentioned this pull request May 2, 2021
@kirchsth kirchsth changed the title #146 New layout call SHOW_PERSON_OUTLINE() activates shape "person" #146 New layout call SHOW_PERSON_OUTLINE() activates shape "person"; new $shape argument supports rounded-box and eight-sided shapes May 10, 2021
@kirchsth
Copy link
Member Author

@Potherca, @dannief: I added to this branch the rounded-box and eight-sided shapes too that we can draw diagrams like below

@startuml
!include https://raw.githubusercontent.com/kirchsth/C4-PlantUML/extended/C4_Container.puml
' uncomment the following line and comment the first to use locally
' !include C4_Container.puml

AddElementTag("micro service", $shape=EightSidedShape(), $bgColor="CornflowerBlue", $fontColor="white")
AddElementTag("storage", $shape=RoundedBoxShape(), $bgColor="lightSkyBlue", $fontColor="white")

SHOW_PERSON_OUTLINE()

Person(customer, Customer, "A customer")

System_Boundary(c1, "Customer Information") {
    Container(app, "Customer Application", "Javascript, Angular", "Allows customers to manage their profile")
    Container(customer_service, "Customer Service", "Java, Spring Boot", "The point of access for customer information", $tags = "micro service")
    Container(message_bus, "Message Bus", "RabbitMQ", "Transport for business events")
    Container(reporting_service, "Reporting Service", "Ruby", "Creates normalised data for reporting purposes", $tags = "micro service")
    Container(audit_service, "Audit Service", "C#/.NET", "Provides organisation-wide auditing facilities", $tags = "micro service")
    ContainerDb(customer_db, "Customer Database", "Oracle 12c", "Stores customer information", $tags = "storage")
    ContainerDb(reporting_db, "Reporting Database", "MySQL", "Stores a normalized version of all business data for ad hoc reporting purposes", $tags = "storage")
    Container(audit_store, "Audit Store", "Event Store", "Stores information about events that have happened", $tags = "storage")
}

Rel_D(customer, app, "Uses", "HTTPS")

Rel_D(app, customer_service, "Updates customer information using", "async, JSON/HTTPS")

Rel_U(customer_service, app, "Sends events to", "WebSocket")
Rel_U(customer_service, message_bus, "Sends customer update events to")
Rel(customer_service, customer_db, "Stores data in", "JDBC")

Rel(message_bus, reporting_service, "Sends customer update events to")
Rel(message_bus, audit_service, "Sends customer update events to")

Rel(reporting_service, reporting_db, "Stores data in")
Rel(audit_service, audit_store, "Stores events in")

Lay_R(reporting_service, audit_service)

SHOW_LEGEND()
@enduml

I plan no other additional shapes.

BR Helmut

@dannief
Copy link

dannief commented May 17, 2021

Hello @kirchsth @Potherca,

Is there a timeline for merging and integration into the parent plantuml project?

@kirchsth
Copy link
Member Author

Hi @adrianvlupu, @aheil, @IOrlandoni, @RicardoNiepel, @michiel and @stawirej
has somebody time for a second review of the open PRs that we can create an new version based on the finished PRs?
Thank you and best regards
Helmut

@Potherca Potherca linked an issue Jul 2, 2021 that may be closed by this pull request
@Potherca Potherca merged commit a32f7d8 into plantuml-stdlib:master Jul 4, 2021
@kirchsth kirchsth deleted the feature/143_incl_C4Person branch July 4, 2021 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

New layout call SHOW_PERSON_OUTLINE() offers "Structurizr" persons Microservice container

3 participants