Skip to content

Commit

Permalink
Updated to meet standard
Browse files Browse the repository at this point in the history
  • Loading branch information
NJ-Brad committed Oct 6, 2020
1 parent 5427436 commit 571d912
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 94 deletions.
164 changes: 128 additions & 36 deletions C4.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
' Colors
' ##################################

!define ELEMENT_FONT_COLOR #FFFFFF
!procedure ELEMENT_FONT_COLOR()
#FFFFFF
!endprocedure

' Styling
' ##################################

!define TECHN_FONT_SIZE 12
!$TECHN_FONT_SIZE=12

skinparam defaultTextAlignment center

Expand Down Expand Up @@ -50,57 +52,147 @@ skinparam defaultFontName "Comic Sans MS"
center footer <font color=red>Warning:</font> Created for discussion, needs to be validated
!endprocedure

!define LAYOUT_TOP_DOWN() top to bottom direction
!define LAYOUT_LEFT_RIGHT() left to right direction
!procedure LAYOUT_TOP_DOWN()
top to bottom direction
!endprocedure

!procedure LAYOUT_LEFT_RIGHT()
left to right direction
!endprocedure

' Boundaries
' ##################################

!define Boundary(e_alias, e_label) rectangle "==e_label" <<boundary>> as e_alias
!define Boundary(e_alias, e_label, e_type) rectangle "==e_label\n<size:TECHN_FONT_SIZE>[e_type]</size>" <<boundary>> as e_alias
!unquoted procedure Boundary(e_alias, e_label)
rectangle "==e_label" <<boundary>> as e_alias
!endprocedure

!unquoted procedure Boundary(e_alias, e_label, e_type)
rectangle "==e_label\n<size:$TECHN_FONT_SIZE>[e_type]</size>" <<boundary>> as e_alias
!endprocedure

' Relationship
' ##################################

!define Rel_(e_alias1, e_alias2, e_label, e_direction="") e_alias1 e_direction e_alias2 : "===e_label"
!define Rel_(e_alias1, e_alias2, e_label, e_techn, e_direction="") e_alias1 e_direction e_alias2 : "===e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//"
!unquoted procedure Rel_(e_alias1, e_alias2, e_label, e_direction="")
e_alias1 e_direction e_alias2 : "===e_label"
!endprocedure

!unquoted procedure Rel_(e_alias1, e_alias2, e_label, e_techn, e_direction="")
e_alias1 e_direction e_alias2 : "===e_label\n//<size:$TECHN_FONT_SIZE>[e_techn]</size>//"
!endprocedure

!unquoted procedure Rel(e_from,e_to, e_label)
Rel_(e_from,e_to, e_label, "-->")
!endprocedure

!unquoted procedure Rel(e_from,e_to, e_label, e_techn)
Rel_(e_from,e_to, e_label, e_techn, "-->")
!endprocedure

!unquoted procedure Rel_Back(e_to, e_from, e_label)
Rel_(e_to, e_from, e_label, "<--")
!endprocedure

!unquoted procedure Rel_Back(e_to, e_from, e_label, e_techn)
Rel_(e_to, e_from, e_label, e_techn, "<--")
!endprocedure

!unquoted procedure Rel_Neighbor(e_from, e_to, e_label)
Rel_(e_from,e_to, e_label, "->")
!endprocedure

!unquoted procedure Rel_Neighbor(e_from, e_to, e_label, e_techn)
Rel_(e_from,e_to, e_label, e_techn, "->")
!endprocedure

!unquoted procedure Rel_Back_Neighbor(e_to, e_from, e_label)
Rel_(e_to, e_from, e_label, "<-")
!endprocedure

!unquoted procedure Rel_Back_Neighbor(e_to, e_from, e_label, e_techn)
Rel_(e_to, e_from, e_label, e_techn, "<-")
!endprocedure

!unquoted procedure Rel_D(e_from,e_to, e_label)
Rel_(e_from,e_to, e_label, "-DOWN->")
!endprocedure

!unquoted procedure Rel_D(e_from,e_to, e_label, e_techn)
Rel_(e_from,e_to, e_label, e_techn, "-DOWN->")
!endprocedure

!unquoted procedure Rel_Down(e_from,e_to, e_label)
Rel_D(e_from,e_to, e_label)
!endprocedure

!unquoted procedure Rel_Down(e_from,e_to, e_label, e_techn)
Rel_D(e_from,e_to, e_label, e_techn)
!endprocedure

!unquoted procedure Rel_U(e_from,e_to, e_label)
Rel_(e_from,e_to, e_label, "-UP->")
!endprocedure

!unquoted procedure Rel_U(e_from,e_to, e_label, e_techn)
Rel_(e_from,e_to, e_label, e_techn, "-UP->")
!endprocedure

!unquoted procedure Rel_Up(e_from,e_to, e_label)
Rel_U(e_from,e_to, e_label)
!endprocedure

!unquoted procedure Rel_Up(e_from,e_to, e_label, e_techn)
Rel_U(e_from,e_to, e_label, e_techn)
!endprocedure

!define Rel(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-->")
!define Rel(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-->")
!unquoted procedure Rel_L(e_from,e_to, e_label)
Rel_(e_from,e_to, e_label, "-LEFT->")
!endprocedure

!define Rel_Back(e_to, e_from, e_label) Rel_(e_to, e_from, e_label, "<--")
!define Rel_Back(e_to, e_from, e_label, e_techn) Rel_(e_to, e_from, e_label, e_techn, "<--")
!unquoted procedure Rel_L(e_from,e_to, e_label, e_techn)
Rel_(e_from,e_to, e_label, e_techn, "-LEFT->")
!endprocedure

!define Rel_Neighbor(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "->")
!define Rel_Neighbor(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "->")
!unquoted procedure Rel_Left(e_from,e_to, e_label)
Rel_L(e_from,e_to, e_label)
!endprocedure

!define Rel_Back_Neighbor(e_to, e_from, e_label) Rel_(e_to, e_from, e_label, "<-")
!define Rel_Back_Neighbor(e_to, e_from, e_label, e_techn) Rel_(e_to, e_from, e_label, e_techn, "<-")
!unquoted procedure Rel_Left(e_from,e_to, e_label, e_techn)
Rel_L(e_from,e_to, e_label, e_techn)
!endprocedure

!define Rel_D(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-DOWN->")
!define Rel_D(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-DOWN->")
!define Rel_Down(e_from,e_to, e_label) Rel_D(e_from,e_to, e_label)
!define Rel_Down(e_from,e_to, e_label, e_techn) Rel_D(e_from,e_to, e_label, e_techn)
!unquoted procedure Rel_R(e_from,e_to, e_label)
Rel_(e_from,e_to, e_label, "-RIGHT->")
!endprocedure

!define Rel_U(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-UP->")
!define Rel_U(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-UP->")
!define Rel_Up(e_from,e_to, e_label) Rel_U(e_from,e_to, e_label)
!define Rel_Up(e_from,e_to, e_label, e_techn) Rel_U(e_from,e_to, e_label, e_techn)
!unquoted procedure Rel_R(e_from,e_to, e_label, e_techn)
Rel_(e_from,e_to, e_label, e_techn, "-RIGHT->")
!endprocedure

!define Rel_L(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-LEFT->")
!define Rel_L(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-LEFT->")
!define Rel_Left(e_from,e_to, e_label) Rel_L(e_from,e_to, e_label)
!define Rel_Left(e_from,e_to, e_label, e_techn) Rel_L(e_from,e_to, e_label, e_techn)
!unquoted procedure Rel_Right(e_from,e_to, e_label)
Rel_R(e_from,e_to, e_label)
!endprocedure

!define Rel_R(e_from,e_to, e_label) Rel_(e_from,e_to, e_label, "-RIGHT->")
!define Rel_R(e_from,e_to, e_label, e_techn) Rel_(e_from,e_to, e_label, e_techn, "-RIGHT->")
!define Rel_Right(e_from,e_to, e_label) Rel_R(e_from,e_to, e_label)
!define Rel_Right(e_from,e_to, e_label, e_techn) Rel_R(e_from,e_to, e_label, e_techn)
!unquoted procedure Rel_Right(e_from,e_to, e_label, e_techn)
Rel_R(e_from,e_to, e_label, e_techn)
!endprocedure

' Layout Helpers
' ##################################

!define Lay_D(e_from, e_to) e_from -[hidden]D- e_to
!define Lay_U(e_from, e_to) e_from -[hidden]U- e_to
!define Lay_R(e_from, e_to) e_from -[hidden]R- e_to
!define Lay_L(e_from, e_to) e_from -[hidden]L- e_to
!unquoted procedure Lay_D(e_from, e_to)
e_from -[hidden]D- e_to
!endprocedure

!unquoted procedure Lay_U(e_from, e_to)
e_from -[hidden]U- e_to
!endprocedure

!unquoted procedure Lay_R(e_from, e_to)
e_from -[hidden]R- e_to
!endprocedure

!unquoted procedure Lay_L(e_from, e_to)
e_from -[hidden]L- e_to
!endprocedure
69 changes: 46 additions & 23 deletions C4_Component.puml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,33 @@
' Colors
' ##################################

!define COMPONENT_BG_COLOR #85BBF0
!procedure COMPONENT_BG_COLOR()
#85BBF0
!endprocedure

!define EXTERNAL_COMPONENT_BG_COLOR #BBBBBB

' Styling
' ##################################

skinparam rectangle<<component>> {
StereotypeFontColor ELEMENT_FONT_COLOR
StereotypeFontColor ELEMENT_FONT_COLOR()
FontColor #000000
BackgroundColor COMPONENT_BG_COLOR
BackgroundColor COMPONENT_BG_COLOR()
BorderColor #78A8D8
}

skinparam database<<component>> {
StereotypeFontColor ELEMENT_FONT_COLOR
StereotypeFontColor ELEMENT_FONT_COLOR()
FontColor #000000
BackgroundColor COMPONENT_BG_COLOR
BackgroundColor COMPONENT_BG_COLOR()
BorderColor #78A8D8
}

skinparam rectangle<<external_component>> {
StereotypeFontColor ELEMENT_FONT_COLOR
StereotypeFontColor ELEMENT_FONT_COLOR()
FontColor #000000
BackgroundColor EXTERNAL_COMPONENT_BG_COLOR
BackgroundColor EXTERNAL_COMPONENT_BG_COLOR()
BorderColor #8A8A8A
}

Expand All @@ -51,28 +54,48 @@ skinparam database<<external_component>> {
hide stereotype
legend right
|= |= Type |
|<PERSON_BG_COLOR> | person |
|<EXTERNAL_PERSON_BG_COLOR> | external person |
|<SYSTEM_BG_COLOR> | system |
|<EXTERNAL_SYSTEM_BG_COLOR> | external system |
|<CONTAINER_BG_COLOR> | container |
|<COMPONENT_BG_COLOR> | component |
|<EXTERNAL_CONTAINER_BG_COLOR> | external container |
|<EXTERNAL_COMPONENT_BG_COLOR> | external component |
|<PERSON_BG_COLOR()> | person |
|<EXTERNAL_PERSON_BG_COLOR()> | external person |
|<SYSTEM_BG_COLOR()> | system |
|<EXTERNAL_SYSTEM_BG_COLOR()> | external system |
|<CONTAINER_BG_COLOR()> | container |
|<COMPONENT_BG_COLOR()> | component |
|<EXTERNAL_CONTAINER_BG_COLOR()> | external container |
|<EXTERNAL_COMPONENT_BG_COLOR()> | external component |
endlegend
!endprocedure

' Elements
' ##################################

!define Component(e_alias, e_label, e_techn) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<component>> as e_alias
!define Component(e_alias, e_label, e_techn, e_descr) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<component>> as e_alias
!unquoted procedure Component(e_alias, e_label, e_techn)
rectangle "==e_label\n//<size:$TECHN_FONT_SIZE>[e_techn]</size>//" <<component>> as e_alias
!endprocedure

!unquoted procedure Component(e_alias, e_label, e_techn, e_descr)
rectangle "==e_label\n//<size:$TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<component>> as e_alias
!endprocedure

!unquoted procedure ComponentDb(e_alias, e_label, e_techn)
database "==e_label\n//<size:$TECHN_FONT_SIZE>[e_techn]</size>//" <<component>> as e_alias
!endprocedure

!unquoted procedure ComponentDb(e_alias, e_label, e_techn, e_descr)
database "==e_label\n//<size:$TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<component>> as e_alias
!endprocedure

!unquoted procedure Component_Ext(e_alias, e_label, e_techn)
rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<external_component>> as e_alias
!endprocedure

!define ComponentDb(e_alias, e_label, e_techn) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<component>> as e_alias
!define ComponentDb(e_alias, e_label, e_techn, e_descr) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<component>> as e_alias
!unquoted procedure Component_Ext(e_alias, e_label, e_techn, e_descr)
rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<external_component>> as e_alias
!endprocedure

!define Component_Ext(e_alias, e_label, e_techn) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<external_component>> as e_alias
!define Component_Ext(e_alias, e_label, e_techn, e_descr) rectangle "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<external_component>> as e_alias
!unquoted procedure ComponentDb_Ext(e_alias, e_label, e_techn)
database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<external_component>> as e_alias
!endprocedure

!define ComponentDb_Ext(e_alias, e_label, e_techn) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//" <<external_component>> as e_alias
!define ComponentDb_Ext(e_alias, e_label, e_techn, e_descr) database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<external_component>> as e_alias
!unquoted procedure ComponentDb_Ext(e_alias, e_label, e_techn, e_descr)
database "==e_label\n//<size:TECHN_FONT_SIZE>[e_techn]</size>//\n\n e_descr" <<external_component>> as e_alias
!endprocedure
Loading

0 comments on commit 571d912

Please sign in to comment.