Skip to content

Commit

Permalink
使用 PlantUML 製作設計圖。
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanJui committed Mar 8, 2024
1 parent 0bc5b21 commit 9e697db
Show file tree
Hide file tree
Showing 23 changed files with 568 additions and 11 deletions.
41 changes: 41 additions & 0 deletions docs/SDD_001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@startuml
start
:Let entSet be a set of Entitlements to revoke;
:Add all dependent entitlements to entSet;
:Delete all dependent entitlements from database;
:Delete pools of entitlements
in entSet that are development pools;
:Update consumed quantity of entSet;
:Delete all entSet entitlements
from database;
:stackPools = filter Entitlements from entSet that
have stacking_id attribute;
partition for-each-entSet {
:stackPool = find stack pool
for entitlement;
:sSet = find all ents that have the
stacking_id;
:Update stackPool based on sSet;
}
:virtEnts = filter Entitlements from entSet that
have virt_limit and are for distributors;
partition for-each-virtEnts {
if (virt_limit == unlimited) then
-> YES;
:Set bonus pool quantity to -1;
else
-> NO;
:Add back reduced pool quantity;
endif
}
:mEnts = get all modifier
entitlements of entSet entitlements;;
:Lazily regenerate entitlement certificates
for all mEnts;
:Compute compliance status for all
Consumers that have an entitlement in entSet;
stop
@enduml

plantuml

9 changes: 9 additions & 0 deletions docs/diagrams/example/C4-Model/c4-001.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@startuml C4_Elements
!include <C4/C4_Container>

Person(personAlias, "Label", "Optional Description")
Container(containerAlias, "Label", "Technology", "Optional Description")
System(systemAlias, "Label", "Optional Description")

Rel(personAlias, containerAlias, "Label", "Optional Technology")
@enduml
21 changes: 21 additions & 0 deletions docs/diagrams/example/C4-Model/c4-002.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@startuml
!include <C4/C4_Container>

!define DEVICONS https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/devicons
!define FONTAWESOME https://raw.githubusercontent.com/tupadr3/plantuml-icon-font-sprites/master/font-awesome-5
!include DEVICONS/angular.puml
!include DEVICONS/java.puml
!include DEVICONS/msql_server.puml
!include FONTAWESOME/users.puml

LAYOUT_WITH_LEGEND()

Person(user, "Customer", "People that need products", $sprite="users")
Container(spa, "SPA", "angular", "The main interface that the customer interacts with", $sprite="angular")
Container(api, "API", "java", "Handles all business logic", $sprite="java")
ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information", $sprite="msql_server")

Rel(user, spa, "Uses", "https")
Rel(spa, api, "Uses", "https")
Rel_R(api, db, "Reads/Writes")
@enduml
26 changes: 26 additions & 0 deletions docs/diagrams/example/C4-Model/c4-003.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
!include <C4/C4_Container>

AddElementTag("v1.0", $borderColor="#d73027")
AddElementTag("v1.1", $fontColor="#d73027")
AddElementTag("backup", $fontColor="orange")

AddRelTag("backup", $textColor="orange", $lineColor="orange", $lineStyle = DashedLine())

Person(user, "Customer", "People that need products")
Person(admin, "Administrator", "People that administrates the products via the new v1.1 components", $tags="v1.1")
Container(spa, "SPA", "angular", "The main interface that the customer interacts with via v1.0", $tags="v1.0")
Container(spaAdmin, "Admin SPA", "angular", "The administrator interface that the customer interacts with via new v1.1", $tags="v1.1")
Container(api, "API", "java", "Handles all business logic (incl. new v1.1 extensions)", $tags="v1.0+v1.1")
ContainerDb(db, "Database", "Microsoft SQL", "Holds product, order and invoice information")
Container(archive, "Archive", "Audit logging", "Stores 5 years", $tags="backup")

Rel(user, spa, "Uses", "https")
Rel(spa, api, "Uses", "https")
Rel_R(api, db, "Reads/Writes")
Rel(admin, spaAdmin, "Uses", "https")
Rel(spaAdmin, api, "Uses", "https")
Rel_L(api, archive, "Writes", "messages", $tags="backup")

SHOW_LEGEND()
@enduml
26 changes: 26 additions & 0 deletions docs/diagrams/example/C4-Model/c4-004.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@startuml
!include <C4/C4_Container>
HIDE_STEREOTYPE()

Person(a, "A")
Person(b, "B")
Person(c, "C")
Person(d, "D")
Person(e, "E")

BiRel_U(a, b, "talk with")
BiRel_R(a, c, "talk with")
BiRel_D(a, d, "talk with")
BiRel_L(a, e, "talk with")

Person(x, "X")
System(s1, "S1")
System(s2, "S2")
System(s3, "S3")
System(s4, "S4")

Rel_U(x, s1, "uses")
Rel_R(x, s2, "uses")
Rel_D(x, s3, "uses")
Rel_L(x, s4, "uses")
@enduml
39 changes: 39 additions & 0 deletions docs/diagrams/example/C4-Model/c4-005.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@startuml
!include <C4/C4_Container>

' <<<<< this section could be stored in a separate file and reused in all other diagrams too
' it defines new default colors, different default sprites and legend
!$COLOR_A_5 = "#7f3b08"
!$COLOR_A_4 = "#b35806"
!$COLOR_A_3 = "#e08214"
!$COLOR_A_2 = "#fdb863"
!$COLOR_A_1 = "#fee0b6"
!$COLOR_NEUTRAL = "#f7f7f7"
!$COLOR_B_1 = "#d8daeb"
!$COLOR_B_2 = "#b2abd2"
!$COLOR_B_3 = "#8073ac"
!$COLOR_B_4 = "#542788"
!$COLOR_B_5 = "#2d004b"
!$COLOR_REL_LINE = "#8073ac"
!$COLOR_REL_TEXT = "#8073ac"

UpdateElementStyle("person", $bgColor=$COLOR_A_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_1, $shadowing="true", $legendText="Internal user")
UpdateElementStyle("external_person", $bgColor=$COLOR_B_5, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_B_1, $legendText="External user")
UpdateElementStyle("system", $bgColor=$COLOR_A_4, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_A_2, $sprite="robot", $legendText="Our chatbot based system")
UpdateElementStyle("external_system", $bgColor=$COLOR_B_4, $fontColor=$COLOR_NEUTRAL, $borderColor=$COLOR_B_2, $legendText="External system")
UpdateRelStyle($lineColor=$COLOR_REL_LINE, $textColor=$COLOR_REL_TEXT)
' >>>>> end of section

Person(customer, "Personal Banking Customer")
System(banking_system, "Internet Banking System")

System_Ext(mail_system, "E-mail system")
System_Ext(mainframe, "Mainframe Banking System")

Rel(customer, banking_system, "Uses")
Rel_Back(customer, mail_system, "Sends e-mails to")
Rel_Neighbor(banking_system, mail_system, "Sends e-mails")
Rel(banking_system, mainframe, "Uses")

SHOW_LEGEND()
@enduml
52 changes: 52 additions & 0 deletions docs/diagrams/example/C4-Model/c4-006.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@startuml
!include <C4/C4_Container>

!define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
!include osaPuml/Common.puml
!include osaPuml/User/all.puml

!include <office/Servers/database_server>
!include <office/Servers/file_server>
!include <office/Servers/application_server>
!include <office/Concepts/service_application>
!include <office/Concepts/firewall>

AddExternalPersonTag("anonymous_ext", $sprite="osa_user_black_hat", $legendText="anonymous user")
AddPersonTag("customer", $sprite="osa_user_large_group", $legendText="aggregated user")
AddPersonTag("admin", $sprite="osa_user_audit,color=red", $legendSprite="osa_user_audit,scale=0.25,color=red", $legendText="administration user")

AddContainerTag("webApp", $sprite="application_server", $legendText="web app container")
AddContainerTag("db", $sprite="database_server", $legendText="database container")
AddContainerTag("files", $sprite="file_server", $legendText="file server container")
AddContainerTag("conApp", $sprite="service_application", $legendText="console app container")

AddRelTag("firewall", $textColor="$ARROW_FONT_COLOR", $lineColor="$ARROW_COLOR", $sprite="firewall,scale=0.3,color=red", $legendText="firewall")

Person_Ext(anonymous_user, "Bob", $tags="anonymous_ext")
Person(aggregated_user, "Sam, Ivone", $tags="customer")
Person(administration_user, "Bernd", $tags="admin")

System_Boundary(c1, "techtribes.js"){
Container(web_app, "Web Application", "Java, Spring MVC, Tomcat 7.x", $tags="webApp")
ContainerDb(rel_db, "Relational Database", "MySQL 5.5.x", $tags="db")
Container(filesystem, "File System", "FAT32", $tags="files")
ContainerDb(nosql, "NoSQL Data Store", "MongoDB 2.2.x", $tags="db")
Container(updater, "Updater", "Java 7 Console App", $tags="conApp")
}

Rel(anonymous_user, web_app, "Uses", "HTTPS", $tags="firewall")
Rel(aggregated_user, web_app, "Uses", "HTTPS", $tags="firewall")
Rel(administration_user, web_app, "Uses", "HTTPS", $tags="firewall")

Rel(web_app, rel_db, "Reads from and writes to", "SQL/JDBC, port 3306")
Rel(web_app, filesystem, "Reads from")
Rel(web_app, nosql, "Reads from", "MongoDB wire protocol, port 27017")

Rel_U(updater, rel_db, "Reads from and writes data to", "SQL/JDBC, port 3306")
Rel_U(updater, filesystem, "Writes to")
Rel_U(updater, nosql, "Reads from and writes to", "MongoDB wire protocol, port 27017")

Lay_R(rel_db, filesystem)

SHOW_LEGEND()
@enduml
29 changes: 29 additions & 0 deletions docs/diagrams/example/C4-Model/c4-007.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@startuml
!include <C4/C4_Container>

' default header Property, Value
AddProperty("Name", "Flash")
AddProperty("Organization", "Zootopia")
AddProperty("Tool", "Internet Explorer 7.0")
Person(personAlias, "Label", "Optional Description (with default property header)")

SetPropertyHeader("Property","Value", "Description")
AddProperty("Prop1", "Value1", "Details1")
AddProperty("Prop2", "Value2", "Details2")
Deployment_Node_L(nodeAlias, "Label", "Optional Type", "Optional Description (with custom property header)") {

WithoutPropertyHeader()
AddProperty("PropC1", "ValueC1")
AddProperty("PropC2", "ValueC2")
Container(containerAlias, "Label", "Technology", "Optional Description (without property header)")
}

System(systemAlias, "Label", "Optional Description (without properties)")

' starting with v.2.5.0 relationships support properties too
WithoutPropertyHeader()
AddProperty("PropC1", "ValueC1")
AddProperty("PropC2", "ValueC2")
Rel(personAlias, containerAlias, "Label", "Optional Technology", "Optional Description")

@enduml
18 changes: 18 additions & 0 deletions docs/diagrams/example/C4-Model/tree-table-001.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@startsalt
{
{T
+ World
++ America
+++ Canada
+++ USA
++++ New York
++++ Boston
+++ Mexico
++ Europe
+++ Italy
+++ Germany
++++ Berlin
++ Africa
}
}
@endsalt
7 changes: 7 additions & 0 deletions docs/diagrams/example/C4-Model/wirefirmae-002.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@startsalt
{+
Login | "MyName "
Password | "**** "
[Cancel] | [ OK ]
}
@endsalt
9 changes: 9 additions & 0 deletions docs/diagrams/example/C4-Model/wireframe-001.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@startsalt
{^"登入系統"
用户名 | "UserName "
密 碼 | "**** "
[取消] | [登入]
}
@endsalt


25 changes: 25 additions & 0 deletions docs/diagrams/example/SDD-001.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@startyaml
#highlight "切語上字"
#highlight "切語上字" / "漢字"
#highlight "切語下字"
#highlight "切語下字" / "漢字"

' 欲查詢《廣韻》切語之漢字,如:東
漢字: "東"
切語: "德紅"
切語上字:
漢字: 德
發聲部位: 舌頭音
聲母: 德
擬音: t
清濁: 清
切語下字:
漢字: 紅
jip: 通
韻目: 東
等: 一
呼: 開
韻母: 東一
調: 平
擬音: ong
@endyaml
35 changes: 35 additions & 0 deletions docs/diagrams/example/a001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 產生注音檔作業流桯

```plantuml
@startuml
skinparam shadowing false
title 產生注音檔\n
skinparam activity {
StartColor limegreen
EndColor darkblue
BackgroundColor #d4de5e
BorderColor #5e94de
ArrowColor black
}
skinparam activityDiamond {
BackgroundColor #5ede68
BorderColor #5e94de
fontSize 16
}
start
:新建 Excel 檔案;
:設定 A 欄的格式
欄寬為 128
可自動換行;
:自模版檔案
複製 output 工作表;
:將新建之 Excel 檔案命名為 Piau-Tsu-Im.xlsx
存放於 output 目錄中;
stop
@enduml
```
31 changes: 31 additions & 0 deletions docs/diagrams/example/a001.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@startuml
skinparam shadowing false

title 產生注音檔\n

skinparam activity {
StartColor limegreen
EndColor darkblue
BackgroundColor #d4de5e
BorderColor #5e94de
ArrowColor black
}
skinparam activityDiamond {
BackgroundColor #5ede68
BorderColor #5e94de
fontSize 16
}

start
:新建 Excel 檔案;
:設定 A 欄的格式
欄寬為 128
可自動換行;
:自模版檔案
複製 output 工作表;
:將新建之 Excel 檔案命名為 Piau-Tsu-Im.xlsx
存放於 output 目錄中;

stop

@enduml
Loading

0 comments on commit 9e697db

Please sign in to comment.