mirror of
https://github.com/plantuml-stdlib/C4-PlantUML.git
synced 2022-10-18 01:14:54 +00:00
Merge pull request #147 from kirchsth/feature/143_incl_C4Person
#146 New layout call SHOW_PERSON_OUTLINE() activates shape "person"; new $shape argument supports rounded-box and eight-sided shapes
This commit is contained in:
@@ -15,17 +15,27 @@
|
||||
!global $LEGEND_UNDEFINED_BG_COLOR = "#D5CFEE"
|
||||
!global $LEGEND_UNDEFINED_FONT_COLOR = "#8B77E4"
|
||||
|
||||
' Labels
|
||||
' ##################################
|
||||
|
||||
!global $LEGEND_SHADOW_TEXT = "(shadow) "
|
||||
!global $LEGEND_NO_SHADOW_TEXT = "(no shadow) "
|
||||
!global $LEGEND_NO_FONT_BG_TEXT = "(no text, no back color) "
|
||||
!global $LEGEND_NO_FONT_TEXT = "(no text color) "
|
||||
!global $LEGEND_NO_BG_TEXT = "(no back color) "
|
||||
!global $LEGEND_NO_LINE_TEXT = "(no line color) "
|
||||
!global $LEGEND_ROUNDED_BOX = "(rounded box) "
|
||||
!global $LEGEND_EIGHT_SIDED = "(eight sided) "
|
||||
|
||||
' Styling
|
||||
' ##################################
|
||||
|
||||
!global $TECHN_FONT_SIZE = 12
|
||||
!global $ROUNDED_BOX_SIZE = 25
|
||||
!global $EIGHT_SIDED_SIZE = 18
|
||||
|
||||
!global $ROUNDED_BOX = "roundedBox"
|
||||
!global $EIGHT_SIDED = "eightSided"
|
||||
|
||||
skinparam defaultTextAlignment center
|
||||
|
||||
@@ -70,6 +80,11 @@ skinparam actor {
|
||||
style awesome
|
||||
}
|
||||
|
||||
skinparam person {
|
||||
StereotypeFontSize 12
|
||||
shadowing false
|
||||
}
|
||||
|
||||
' Some boundary skinparams have to be set as package skinparams too (PlantUML uses internal packages)
|
||||
skinparam package {
|
||||
StereotypeFontSize 6
|
||||
@@ -139,7 +154,7 @@ skinparam rectangle<<boundary>> {
|
||||
!return $stereos
|
||||
!endfunction
|
||||
|
||||
!function $elementTagSkinparams($element, $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!function $elementTagSkinparams($element, $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
!$elementSkin = "skinparam " + $element +"<<" + $tagStereo + ">> {" + %newline()
|
||||
!if ($fontColor!="")
|
||||
!if ($tagStereo != "boundary")
|
||||
@@ -159,16 +174,26 @@ skinparam rectangle<<boundary>> {
|
||||
!if ($shadowing == "false")
|
||||
!$elementSkin = $elementSkin + " Shadowing<<" + $tagStereo + ">> " + "false" + %newline()
|
||||
!endif
|
||||
' only rectangle supports shape(d corners)
|
||||
!if ($shape!="" && $element == "rectangle")
|
||||
!if ($shape == $ROUNDED_BOX)
|
||||
!$elementSkin = $elementSkin + " RoundCorner " + $ROUNDED_BOX_SIZE+ %newline()
|
||||
!elseif ($shape == $EIGHT_SIDED)
|
||||
!$elementSkin = $elementSkin + " DiagonalCorner " + $EIGHT_SIDED_SIZE+ %newline()
|
||||
!endif
|
||||
!endif
|
||||
!$elementSkin = $elementSkin + "}" + %newline()
|
||||
!return $elementSkin
|
||||
!endfunction
|
||||
|
||||
!unquoted procedure $defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!$tagSkin = $elementTagSkinparams("rectangle", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("database", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("queue", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!unquoted procedure $defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
' only rectangle supports shape(d corners)
|
||||
!$tagSkin = $elementTagSkinparams("rectangle", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("database", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("queue", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
|
||||
' actor has style awesome, therefore $fontColor is ignored and text uses $bgColor too
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing)
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("actor", $tagStereo, $bgColor, $bgColor, $borderColor, $shadowing, "")
|
||||
!$tagSkin = $tagSkin + $elementTagSkinparams("person", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, "")
|
||||
!if ($tagStereo == "boundary" && $bgColor!="")
|
||||
!$tagSkin = $tagSkin + "skinparam package<<boundary>>StereotypeFontColor " + $bgColor + %newline()
|
||||
!$tagSkin = $tagSkin + "skinparam rectangle<<boundary>>StereotypeFontColor " + $bgColor + %newline()
|
||||
@@ -198,7 +223,7 @@ $tagSkin
|
||||
$elementSkin
|
||||
!endprocedure
|
||||
|
||||
!function $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!function $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
!$tagEntry = "|"
|
||||
!if ($bgColor!="")
|
||||
!$bg = $bgColor
|
||||
@@ -228,6 +253,12 @@ $elementSkin
|
||||
!if ($shadowing == "false")
|
||||
!$tagEntry = $tagEntry + $LEGEND_NO_SHADOW_TEXT
|
||||
!endif
|
||||
!if ($shape == $ROUNDED_BOX)
|
||||
!$tagEntry = $tagEntry + $LEGEND_ROUNDED_BOX
|
||||
!endif
|
||||
!if ($shape == $EIGHT_SIDED)
|
||||
!$tagEntry = $tagEntry + $LEGEND_EIGHT_SIDED
|
||||
!endif
|
||||
!if ($fontColor == "" && $bgColor == "")
|
||||
!$tagEntry = $tagEntry + $LEGEND_NO_FONT_BG_TEXT
|
||||
!else
|
||||
@@ -268,12 +299,12 @@ $elementSkin
|
||||
!return $tagEntry
|
||||
!endfunction
|
||||
|
||||
!unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="")
|
||||
!unquoted procedure $addTagToLegend($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="")
|
||||
'' if a combined element tag is defined (e.g. "v1.0&v1.1") then it is typically a merged color,
|
||||
'' like a new $fontColor="#fdae61" therefore it should be added to the legend
|
||||
'' and the & combined tags will be not removed
|
||||
' !if (%strpos($tagStereo, "&")<0)
|
||||
!$tagEntry = $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!$tagEntry = $tagLegendEntry($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
%set_variable_value("$" + $tagStereo + "LegendEntry", $tagEntry)
|
||||
!$tagCustomLegend = $tagCustomLegend + $tagStereo + "\n"
|
||||
' !endif
|
||||
@@ -311,10 +342,18 @@ $elementSkin
|
||||
!endif
|
||||
!endprocedure
|
||||
|
||||
!function RoundedBoxShape()
|
||||
!return $ROUNDED_BOX
|
||||
!endfunction
|
||||
|
||||
!function EightSidedShape()
|
||||
!return $EIGHT_SIDED
|
||||
!endfunction
|
||||
|
||||
' used by new defined tags
|
||||
!unquoted procedure AddElementTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="")
|
||||
$defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
$addTagToLegend($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!unquoted procedure AddElementTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="")
|
||||
$defineSkinparams($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
$addTagToLegend($tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
!endprocedure
|
||||
|
||||
' used by new defined rel tags
|
||||
@@ -324,9 +363,9 @@ $addRelTagToLegend($tagStereo, $textColor, $lineColor)
|
||||
!endprocedure
|
||||
|
||||
' update the style of existing elements like person, ...
|
||||
!unquoted procedure UpdateElementStyle($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="")
|
||||
$defineSkinparams($elementName, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!$tagEntry = $tagLegendEntry($elementName, $bgColor, $fontColor, $borderColor, $shadowing)
|
||||
!unquoted procedure UpdateElementStyle($elementName, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="")
|
||||
$defineSkinparams($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
!$tagEntry = $tagLegendEntry($elementName, $bgColor, $fontColor, $borderColor, $shadowing, $shape)
|
||||
%set_variable_value("$" + $elementName + "LegendEntry", $tagEntry)
|
||||
!endprocedure
|
||||
|
||||
|
||||
+12
-3
@@ -171,7 +171,12 @@ endlegend
|
||||
|
||||
!unquoted procedure SHOW_PERSON_PORTRAIT()
|
||||
!$defaultPersonSprite = ""
|
||||
!$portraitPerson = "true"
|
||||
!$portraitPerson = "portrait"
|
||||
!endprocedure
|
||||
|
||||
!unquoted procedure SHOW_PERSON_OUTLINE()
|
||||
!$defaultPersonSprite = ""
|
||||
!$portraitPerson = "outline"
|
||||
!endprocedure
|
||||
|
||||
' Elements
|
||||
@@ -211,16 +216,20 @@ endlegend
|
||||
!endfunction
|
||||
|
||||
!unquoted procedure Person($alias, $label, $descr="", $sprite="", $tags="", $link="")
|
||||
!if ($portraitPerson == "true") && ($sprite == "")
|
||||
!if ($portraitPerson == "portrait") && ($sprite == "")
|
||||
actor "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link)
|
||||
!elseif ($portraitPerson == "outline") && ($sprite == "")
|
||||
person "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link)
|
||||
!else
|
||||
rectangle "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("person", $tags) as $alias $getLink($link)
|
||||
!endif
|
||||
!endprocedure
|
||||
|
||||
!unquoted procedure Person_Ext($alias, $label, $descr="", $sprite="", $tags="", $link="")
|
||||
!if ($portraitPerson == "true") && ($sprite == "")
|
||||
!if ($portraitPerson == "portrait") && ($sprite == "")
|
||||
actor "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link)
|
||||
!elseif ($portraitPerson == "outline") && ($sprite == "")
|
||||
person "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link)
|
||||
!else
|
||||
rectangle "$getPerson($label, $descr, $sprite)$getProps()" $toStereos("external_person", $tags) as $alias $getLink($link)
|
||||
!endif
|
||||
|
||||
+28
-2
@@ -218,14 +218,15 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS")
|
||||

|
||||
|
||||
|
||||
## HIDE_PERSON_SPRITE(), SHOW_PERSON_SPRITE(?sprite), SHOW_PERSON_PORTRAIT()
|
||||
## HIDE_PERSON_SPRITE(), SHOW_PERSON_SPRITE(?sprite), SHOW_PERSON_PORTRAIT() and SHOW_PERSON_OUTLINE()
|
||||
|
||||
With the macros `HIDE_PERSON_SPRITE()`, `SHOW_PERSON_SPRITE()` and `SHOW_PERSON_PORTRAIT()` it is possible to change the person related default sprite or person layout itself. `SHOW_PERSON_SPRITE()` is the default.
|
||||
|
||||
- **HIDE_PERSON_SPRITE()**: deactivates the default sprite
|
||||
- **SHOW_PERSON_SPRITE()**: activates the default sprite "person"
|
||||
- **SHOW_PERSON_SPRITE($sprite)**: activates a specific sprite as default sprite
|
||||
- **SHOW_PERSON_PORTRAIT()**: activates portrait outline instead of a rectangle
|
||||
- **SHOW_PERSON_PORTRAIT()**: activates portrait instead of a rectangle
|
||||
- **SHOW_PERSON_OUTLINE()**: activates person outline instead of a rectangle
|
||||
|
||||
"person" and "person2" are predefined sprites which can be used as default sprite too.
|
||||
|
||||
@@ -332,3 +333,28 @@ Rel(web_app, twitter, "Gets tweets from", "HTTPS")
|
||||
|
||||
")
|
||||
|
||||
**Using SHOW_PERSON_OUTLINE()**
|
||||
|
||||
> This call requires PlantUML version >= v1.2021.4!
|
||||
|
||||
```csharp
|
||||
@startuml SHOW_PERSON_OUTLINE() Sample
|
||||
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/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
|
||||
```
|
||||
|
||||
")
|
||||
|
||||
@@ -359,7 +359,7 @@ C4-PlantUML also comes with some layout options to make it easy and reusable to
|
||||
|
||||
* [LAYOUT_TOP_DOWN() or LAYOUT_LEFT_RIGHT()](LayoutOptions.md#layout_top_down-or-layout_left_right)
|
||||
* [LAYOUT_WITH_LEGEND() or SHOW_LEGEND(?hideStereotype)](LayoutOptions.md#layout_with_legend-or-show_legend)
|
||||
* [SHOW_LEGEND_UP(alias, ?hideStereotype), SHOW_LEGEND_DOWN(...), SHOW_LEGEND_LEFT(...), SHOW_LEGEND_RIGHT(...)](LayoutOptions.md#show_legend_up-show_legend_down-show_legend_left-show_legend_right)
|
||||
* [SHOW_FLOATING_LEGEND(?alias, ?hideStereotype) and LEGEND()](LayoutOptions.md#show_floating_legendalias-hidestereotype-and-legend)
|
||||
* [LAYOUT_AS_SKETCH()](LayoutOptions.md#layout_as_sketch)
|
||||
* [HIDE_STEREOTYPE()](LayoutOptions.md#hide_stereotype)
|
||||
|
||||
@@ -368,20 +368,22 @@ C4-PlantUML also comes with some person sprite/portrait options:
|
||||
* [HIDE_PERSON_SPRITE()](LayoutOptions.md#hide_person_sprite)
|
||||
* [SHOW_PERSON_SPRITE(?sprite)](LayoutOptions.md#show_person_sprite)
|
||||
* [SHOW_PERSON_PORTRAIT()](LayoutOptions.md#show_person_portrait)
|
||||
* [SHOW_PERSON_OUTLINE()](LayoutOptions.md#show_person_outline) (requires PlantUML version >= 1.2021.4)
|
||||
|
||||
## Custom tags/stereotypes support and skinparam updates
|
||||
|
||||
Additional tags/stereotypes can be added to the existing element stereotypes (component, ...) and highlight,... specific aspects:
|
||||
|
||||
* `AddElementTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing)`:
|
||||
* `AddElementTag(tagStereo, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape)`:
|
||||
Introduces a new element tag. The styles of the tagged elements are updated and the tag is displayed in the calculated legend.
|
||||
* `AddRelTag(tagStereo, ?textColor, ?lineColor)`:
|
||||
Introduces a new relation tag. The styles of the tagged relations are updated and the tag is displayed in the calculated legend.
|
||||
|
||||
* `UpdateElementStyle(elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing)`
|
||||
* `UpdateElementStyle(elementName, ?bgColor, ?fontColor, ?borderColor, ?shadowing, ?shape)`:
|
||||
This call updates the default style of the elements (component, ...) and creates no additional legend entry.
|
||||
* `UpdateRelStyle(textColor, lineColor)`
|
||||
* `UpdateRelStyle(textColor, lineColor)`:
|
||||
This call updates the default relationship colors and creates no additional legend entry.
|
||||
* `RoundedBoxShape()`: This call returns the name of the rounded box shape and can be used as ?shape argument.
|
||||
* `EightSidedShape()`: This call returns the name of the eight sided shape and can be used as ?shape argument.
|
||||
|
||||
Each element can be extended with one or multiple custom tags via the keyword argument `$tags="..."`, like `Container(spaAdmin, "Admin SPA", $tags="v1.1")`.
|
||||
Multiple tags can be combined with `+`, like `Container(api, "API", $tags="v1.0+v1.1")`.
|
||||
@@ -409,6 +411,9 @@ AddElementTag("v1.1", $fontColor="#ffffbf", $borderColor="#ffffbf")
|
||||
AddElementTag("v1.0&v1.1", $fontColor="#fdae61", $borderColor="#fdae61")
|
||||
AddElementTag("fallback", $bgColor="#444444")
|
||||
|
||||
AddElementTag("micro service", $shape=EightSidedShape())
|
||||
AddElementTag("storage", $shape=RoundedBoxShape())
|
||||
|
||||
UpdateRelStyle(black, black)
|
||||
AddRelTag("service1", $textColor="red")
|
||||
AddRelTag("service2", $lineColor="red")
|
||||
@@ -420,24 +425,23 @@ Container(api, "API", "java", "Handles all business logic (incl. new v1.1 extens
|
||||
Container(spa2, "SPA2", "angular", "The main interface that the customer interacts with via v1.0", $tags="v1.0+fallback")
|
||||
Container(spaAdmin2, "Admin SPA2", "angular", "The administrator interface that the customer interacts with via new v1.1", $tags="fallback+v1.1")
|
||||
|
||||
Container(services, "Services", "techn", $tags="micro service")
|
||||
Container(fileStorage, "File storage", "techn", $tags="storage")
|
||||
|
||||
Rel(spa, api, "Uses", "https")
|
||||
Rel(spaAdmin, api, "Uses", "https")
|
||||
Rel_L(spa, spa2, "Updates", "https")
|
||||
Rel_R(spaAdmin, spaAdmin2, "Updates", "https")
|
||||
|
||||
Person(user, "A user")
|
||||
System(system, "A system")
|
||||
Rel_D(api, services, "uses service1 via this call", $tags="service1")
|
||||
Rel_D(api, services, "uses service2 via this call", $tags="service2")
|
||||
Rel_D(services, fileStorage, "both services stores via this call", $tags="service1&service2+service1+service2")
|
||||
|
||||
Rel_D(user, system, "uses service1 via this call", $tags="service1")
|
||||
Rel_D(user, system, "uses service2 via this call", $tags="service2")
|
||||
Rel_D(user, system, "uses both services via this call", $tags="service1&service2+service1+service2")
|
||||
|
||||
Lay_D(api, user)
|
||||
SHOW_LEGEND(false)
|
||||
@enduml
|
||||
```
|
||||
|
||||

|
||||

|
||||
|
||||
**Custom schema definition**
|
||||
|
||||
@@ -587,7 +591,7 @@ Source: [C4_Container Diagram Sample - techtribesjs.puml](samples/C4_Container%2
|
||||
|
||||
Source: [C4_Container Diagram Sample - message bus.puml](samples/C4_Container%20Diagram%20Sample%20-%20message%20bus.puml)
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
## Background
|
||||
|
||||
@@ -17,6 +17,9 @@ AddElementTag("role3", $bgColor="orange")
|
||||
AddElementTag("role4", $borderColor="blue")
|
||||
AddElementTag("unusedRole")
|
||||
|
||||
AddElementTag("micro_service", $shape=EightSidedShape())
|
||||
AddElementTag("storage", $shadowing="true", $shape=RoundedBoxShape())
|
||||
|
||||
AddRelTag("line1", $lineColor="green", $textColor="blue")
|
||||
AddRelTag("line2", $lineColor="blue", $textColor="green")
|
||||
AddRelTag("line3", $textColor="orange")
|
||||
@@ -37,8 +40,8 @@ Person(person13, "Person13", $tags="role1+role3")
|
||||
Person(allInOne, "AllInOne", $tags="role4+role3+role2+role1")
|
||||
|
||||
Component(component, "Component 1", "PlantUML")
|
||||
System(system1A, "System 1A")
|
||||
System(system2, "System 2")
|
||||
System(system1A, "System 1A", $tags="micro_service")
|
||||
System(system2, "System 2", $tags = "storage")
|
||||
|
||||
Rel(allInOne, component, "without a tag")
|
||||
Rel(allInOne, component, "uses line 1", $tags="line1")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
@startuml
|
||||
' convert it with additional command line argument -DRELATIVE_INCLUDE="." to use locally
|
||||
!if %variable_exists("RELATIVE_INCLUDE")
|
||||
!include ./../C4_Deployment.puml
|
||||
!else
|
||||
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml
|
||||
!endif
|
||||
|
||||
!$COLOR_A_5 = "#7f3b08"
|
||||
!$COLOR_A_1 = "#fee0b6"
|
||||
!$COLOR_NEUTRAL = "#f7f7f7"
|
||||
UpdateElementStyle("person", $bgColor=$COLOR_A_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_1, $shadowing="true")
|
||||
|
||||
SHOW_PERSON_OUTLINE()
|
||||
|
||||
' default header Property, Value
|
||||
Person(personAlias, "Label", "Optional Description")
|
||||
Person(personAlias1, "Simple")
|
||||
Person(personAlias2, "Simple with sprite", $sprite="person2")
|
||||
AddProperty("Name", "Flash")
|
||||
AddProperty("Organization", "Zootopia")
|
||||
AddProperty("Tool", "Internet Explorer 7.0")
|
||||
Person_Ext(personAliasExt, "Label Ext", "Optional Description (with default property header)")
|
||||
Person_Ext(personAliasExt1, "Simple Ext")
|
||||
Person_Ext(personAliasExt2, "Simple Ext with sprite", $sprite="person2")
|
||||
|
||||
SHOW_LEGEND()
|
||||
@enduml
|
||||
@@ -3,41 +3,30 @@
|
||||
' uncomment the following line and comment the first to use locally
|
||||
' !include C4_Container.puml
|
||||
|
||||
skinparam wrapWidth 200
|
||||
skinparam maxMessageSize 200
|
||||
|
||||
LAYOUT_TOP_DOWN()
|
||||
'LAYOUT_AS_SKETCH()
|
||||
LAYOUT_WITH_LEGEND()
|
||||
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")
|
||||
|
||||
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")
|
||||
|
||||
Container(audit_service, "Audit Service", "C#/.NET", "Provides organisation-wide auditing facilities")
|
||||
|
||||
ContainerDb(customer_db, "Customer Database", "Oracle 12c", "Stores customer information")
|
||||
|
||||
ContainerDb(reporting_db, "Reporting Database", "MySQL", "Stores a normalized version of all business data for ad hoc reporting purposes")
|
||||
|
||||
Container(audit_store, "Audit Store", "Event Store", "Stores information about events that have happened")
|
||||
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(customer, app, "Uses", "HTTPS")
|
||||
Rel_D(customer, app, "Uses", "HTTPS")
|
||||
|
||||
Rel_R(app, customer_service, "Updates customer information using", "async, JSON/HTTPS")
|
||||
Rel_D(app, customer_service, "Updates customer information using", "async, JSON/HTTPS")
|
||||
|
||||
Rel_L(customer_service, app, "Sends events to", "WebSocket")
|
||||
Rel_R(customer_service, message_bus, "Sends customer update events to")
|
||||
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")
|
||||
@@ -48,4 +37,5 @@ Rel(audit_service, audit_store, "Stores events in")
|
||||
|
||||
Lay_R(reporting_service, audit_service)
|
||||
|
||||
SHOW_LEGEND()
|
||||
@enduml
|
||||
|
||||
Reference in New Issue
Block a user