diff --git a/C4_Container.puml b/C4.puml similarity index 74% rename from C4_Container.puml rename to C4.puml index e8e8fe1..dd3ad4a 100644 --- a/C4_Container.puml +++ b/C4.puml @@ -3,7 +3,9 @@ !define PERSON_BG_COLOR #08427B !define CONTAINER_BG_COLOR #438DD5 -!define SYSTEM_BG_COLOR #999999 +!define EXTERNAL_SYSTEM_BG_COLOR #999999 +!define SYSTEM_BG_COLOR #1168BD +!define COMPONENT_BG_COLOR #85BBF0 !define ELEMENT_FONT_COLOR #FFFFFF ' Styling @@ -40,10 +42,24 @@ skinparam rectangle<> { BorderColor #3C7FC0 } +skinparam rectangle<> { + StereotypeFontColor ELEMENT_FONT_COLOR + FontColor ELEMENT_FONT_COLOR + BackgroundColor COMPONENT_BG_COLOR + BorderColor #3C7FC0 +} + skinparam rectangle<> { StereotypeFontColor ELEMENT_FONT_COLOR FontColor ELEMENT_FONT_COLOR BackgroundColor SYSTEM_BG_COLOR + BorderColor #3C7FC0 +} + +skinparam rectangle<> { + StereotypeFontColor ELEMENT_FONT_COLOR + FontColor ELEMENT_FONT_COLOR + BackgroundColor EXTERNAL_SYSTEM_BG_COLOR BorderColor #8A8A8A } @@ -57,20 +73,23 @@ skinparam package<> { ' ################################## !definelong LAYOUT_AS_SKETCH -skinparam backgroundColor #EEEBDC -skinparam handwritten true -skinparam defaultFontName "Comic Sans MS" -center footer Warning: Created for discussion, needs to be validated + skinparam backgroundColor #EEEBDC + skinparam handwritten true + skinparam defaultFontName "Comic Sans MS" + center footer + Warning: Created for discussion, needs to be validated !enddefinelong !definelong LAYOUT_WITH_LEGEND -hide stereotype -legend right -|= |= Type | -| | person | -| | container | -| | external system | -endlegend + hide stereotype + legend right + |= |= Type | + | | person | + | | system | + | | external system | + | | container | + | | component | + endlegend !enddefinelong !define LAYOUT_TOP_DOWN top to bottom direction @@ -85,9 +104,15 @@ endlegend !define Container(e_alias, e_label, e_techn) rectangle "==e_label\n//[e_techn]//" <> as e_alias !define Container(e_alias, e_label, e_techn, e_descr) rectangle "==e_label\n//[e_techn]//\n\n e_descr" <> as e_alias +!define Component(e_alias, e_label, e_techn) rectangle "==e_label\n//[e_techn]//" <> as e_alias +!define Component(e_alias, e_label, e_techn, e_descr) rectangle "==e_label\n//[e_techn]//\n\n e_descr" <> as e_alias + !define System(e_alias, e_label) rectangle "==e_label" <> as e_alias !define System(e_alias, e_label, e_descr) rectangle "==e_label\n\n e_descr" <> as e_alias +!define ExtSystem(e_alias, e_label) rectangle "==e_label" <> as e_alias +!define ExtSystem(e_alias, e_label, e_descr) rectangle "==e_label\n\n e_descr" <> as e_alias + ' Relationship ' ################################## diff --git a/samples/C4_Component Diagram Sample.puml b/samples/C4_Component Diagram Sample.puml new file mode 100644 index 0000000..b5e28c3 --- /dev/null +++ b/samples/C4_Component Diagram Sample.puml @@ -0,0 +1,24 @@ +@startuml +!include ../C4.puml + +LAYOUT_WITH_LEGEND + +title Container Diagram + +Person(client, "Client", "A user of a system") +package "Platform:system" <> as platform { + Container(api_app, "Mobile App", "Android / IOS", "Uses SDK for direct calls") + package "Web App:container" <> as api_dash { + Component(c1, "User Controller", "MVC REST Controller", "Lorem ipsum") + Component(c2, "Product Controller", "MVC REST Controller", "Lorem ipsum") + } +} +ExtSystem(3rdparty, "3rd Party Platform", "Implements actual business logic") + +Rel(client, platform, "Uses") +Rel(client, 3rdparty, "Uses") +Rel(api_dash, 3rdparty, "Uses", "REST API") +Rel(api_app, 3rdparty, "Uses", "SDK") +Rel(api_app, c2, "Query", "SDK") +Rel(api_app, c1, "Query", "SDK") +@enduml diff --git a/samples/C4_Container Diagram Sample.puml b/samples/C4_Container Diagram Sample.puml new file mode 100644 index 0000000..a2903db --- /dev/null +++ b/samples/C4_Container Diagram Sample.puml @@ -0,0 +1,19 @@ +@startuml +!include ../C4.puml + +LAYOUT_WITH_LEGEND + +title Container Diagram + +Person(client, "Client", "A user of a system") +package "Platform" <> as platform { + Container(api_app, "Mobile App", "Android / IOS", "Uses SDK for direct calls") + Container(api_dash, "Web App", "asp.net", "Covers one or more business needs") +} +ExtSystem(3rdparty, "3rd Party Platform", "Implements actual business logic") + +Rel(client, platform, "Uses") +Rel(client, 3rdparty, "Uses") +Rel(api_dash, 3rdparty, "Uses", "REST API") +Rel(api_app, 3rdparty, "Uses", "SDK") +@enduml diff --git a/samples/C4_Context Diagram Sample.puml b/samples/C4_Context Diagram Sample.puml new file mode 100644 index 0000000..3b43b44 --- /dev/null +++ b/samples/C4_Context Diagram Sample.puml @@ -0,0 +1,15 @@ +@startuml +!include ../C4.puml + +LAYOUT_WITH_LEGEND + +title System Context Diagram + +Person(client, "Client", "A user of a system") +System(platform, "Platform", "Distributed system of independent Machines") +ExtSystem(3rdparty, "3rd Party Platform", "Implements actual business logic") + +Rel(client, platform, "Uses") +Rel(client, 3rdparty, "Uses") +Rel(3rdparty, platform, "Depends on", "SDK, REST API") +@enduml