plantuml样式_GitHub - visoeclipse/plantuml-style-c4: 自定义的plantuml 样式

自定义 PlantUml 和 C4 Model 样式

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f52503931527a696d33384e6c2d584e5367536358335a686976306e4f5867386a546a61417a78335a4f43587138654963463862517537795f6f4f497a35523045574b492d7a5f493979496241366f4744503375756a66477758386c3836456c3338563575464c564d337555484d5977512d6f574a7552747a5437676537676746312d69334c63436e7471375968316f473155493271376959567444793164414371373837787a656b6e42707061323832555469494a55506b3956594e517277516677566c6c787573704f2d566e665750726a494676457072335343564767616b45506f6d6d547939652d707348724370746331697074577168655654517a764c646a5f47666b316155686f576c557542315344454769417a57526e67625634745464443867484d745979792d74446847564c617978444d58686b306a6e6659394d4f4164674352354e41674534794165695a6f465a4858544b566f7535663078722d6a66764e5a724b4c52745846367a5655346c6769705f554d715948544a526a6b476c4d444a527a7777593966536e67367848513670564b69497a714c423178336d3478356e306b79355142777262376953764863556a766277376c5674452d62637834464a464666686a317a4f4146377933383359437230682d33772d5f5058787641485f4947377931

什么是 PlantUml

PlantUml是一个支持快速绘制的开源项目.其定义了一套完整的语言用于实现 UML 关系图的描述.并基于强大的 graphviz 图形渲染库进行 UML 图的生成.绘制的 UML 图还可以导出为图片,以及通用的矢量 SVG 格式文件.

如以下代码,可实现时序图

@startuml

Alice -> Bob: Authentication Request

Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request

Alice

@enduml

68747470733a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f696d672f54537831334f305733384e5845724471574976575a30353753304634396639574b495a784979494a6d564678796b566642335039454f386f6d4a693264363245776d32636f3475697462646e614d36586772304d4c4a5630515878534b5663436434627a4f6e6f6849733378714f50376e41526a6474785a6364596858737930

可以使用常用的编辑器 vscode 或者 sublime 或者其他 IDE 工具继承 PlantUml

想了解更多 PlantUml 或者使用方法,可参考官网http://plantuml.com/zh/,上面详细的中英文说明

什么是 C4 Model

C4 Model 在我眼里更像是一个标准,一个方法论。让架构师、程序员、业务人员在讨论 IT 系统架构时候统一维度,统一标准,更方便的理解和沟通 IT 系统中的真实问题。强烈推荐!!!

C4 模型由一系列分层的软件架构图组成,这些架构图用于描述上下文(Context)、容器(Container)、组件(Component)和代码(Code)。C4 图的层次结构提供了不同的抽象级别,每种抽象级别都与不同的受众有关

68747470733a2f2f63346d6f64656c2e636f6d2f696d672f62696762616e6b706c632d436f6e7461696e6572732e706e67

本库只是一个样式库

本库的目的是美化 PlantUml 和 C4 Model 所绘制系统架构图的样式,统一审美而产生。

1.时序图

在 PlantUml 代码中引用

@startuml sequence-sample

!include https://unpkg.com/plantuml-style-c4@latest/core.puml

' uncomment the following line and comment the first to use locally

'!include core.puml

LAYOUT_AS_SKETCH()

' 设置红色箭头,分图定义有冲突

RED_ARROW

'MEGENTA_ARROW

title <20>Sample Sequence20>

actor User

participant "First Class" as A

participant "Second Class" as B

participant "Last Class" as C

User -> A: DoWork

activate A

note over A: this is a first note

A -> B: Create Request

activate B

B -> C: DoWork

activate C

C --> B: WorkDone

destroy C

B --> A: Request Created

deactivate B

A --> User: Done

deactivate A

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f50503146516e44313643526c796f62555575615571584e6e6a3949476f494f674d3272614b75676443436f2d44614464507a5150546f6c6e76674b4f79314565395f34616334466e6563575f5a4d6a77796f6975716f75735978326d33425f6470706d707a32475372514c636a7649486b5975473561494c4a764561446a4e3979517771504c39664f5141637873636669495f6c33784b577a39483877743274596b755572325038497047346a34317552684d7342764b7631677143575a30355442316f64653069723176314d6f63714e6842556c6f6c537642397a5f6b7057533352642d4a6e5f463962625a737856324c734e77756c44705f4e632d795642725662635f514e767a464e465a785644637846635f4b4d70566c5668732d687458724c70546878765f396644392d4376647175465a625a6c6f554a58764563436a715436595a4a326462556c43427274547632426957686437355f4b51324a6b3948344336314549683844335a75764c6d663649675841364f455631724f4843322d7a7447375a574e506f5a6a41524f7567436b746e53545479504f6838332d303757414f746a61744b63694c6755324336475236747873353574346a3530556d59565154756f4779555754665030765a395066744537663963463473325841696c5f5a437650315f7a65546d54575150344b6d457869434244676b687a4c636a584c3571366f64796f6a504e393532367834724f38596367346c7a356d3030

2. 类图

以下为示例

@startuml 示例类图

!include https://unpkg.com/plantuml-style-c4@latest/core.puml

' uncomment the following line and comment the first to use locally

'!include core.puml

GREY_ARROW

abstract class BaseClass {

+ AbstractMethod() : void

# VirtualMethod(s:string) : int

}

class SubClass {

+ AbstractMethod() : void

# VirtualMethod(s:string) : int

}

interface IInterfaceA {

}

interface "IInterfaceA`1" {

Value : T <>

}

class ImplementClass {

+ Value : int <>

}

BaseClass

IInterfaceA

"IInterfaceA`1" ""

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f58503331496c6a303443526c2d6e4a70705f7a4748543857553265586a386638336f424b4b6c3661737973714e507069586b6f6b4b676646753244757a474d79416c486662427736637051734a472d51497352766c6c6463447a43736258564d50474942725f56462d564659785546685053784f467761346b4848584f63726b4d6237614c37757452576754484a626e4c4e51346e6175394774374b3963784873345a6530666b764c7257336446424d33394b354571344f5149427a38444b4f49326534686241656f52386d6c6a4257333039666d4f6363684235367345496f697a78667a4b736472786b754f656d465a49737569323238366d4637744533396966656e794479314741546f644145547737486c3772666d68734d776246793333414a566435456263664f7455794a4939504c624a736f4c552d63367a545a564b5f7941505677376e4f574258367874662d7030683275354d7a686a4f4833746173687957394433377a51374531775a4a5038725070564232536b4a72636368586442774c696c634d46355a3641767450446a38665238426d645255344348497349484f635569385a424c486649775a526d3030

3. 状态图

@startuml state-sample

!include https://unpkg.com/plantuml-style-c4@latest/core.puml

' uncomment the following line and comment the first to use locally

'!include core.puml

GREEN_ARROW

title HTTP Request Parsing States

[*] --> RequestLine

RequestLine : Parse HTTP

RequestLine : request line

RequestLine --> Headers : Ok

RequestLine --> Error : Failure

Headers : Parse HTTP

Headers : headers

Headers --> Host : Ok

Headers --> Error : Failure

Host : Check host

Host : header is present

Host --> Length : Not chunked

Host --> Chunked : Chunked

Host --> Error : Failure

Length : Check if required,

Length : valid & size

Length --> Error : Failure

Length --> Error : Entity Too Large

Length --> [*] : Ok

Chunked : Parse HTTP

Chunked : chunk header

Chunked --> Error : Failure

Chunked --> [*] : Ok

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f5250366e786a436d3438547446794d6e4b306348506337675738676747385567684b386231654947624c6d4a416e537873365447554e675363444934567052787a76735f6b7270735a674c62746e45343073466350337947596254414c2d486858395076534269797a746865636372622d646d5767535337635543374f4c517a7376446154396e4e6e6b3973323448696d456a47736744637531525852655a4342774b5238414b486641765857504c72754d4a30456d476f62494877594372705845474c6479675945375f5f4b39514e4271416d4f6138757463764e414636376e2d3275496b6c3644667a763734633868732d2d4750517a645f6166543153594e483173717644652d475f4f55396a364e6731485534485065744d587844417a57384d726e5752714b49686f35654c3872567a71497334524a744349366e5a3771507849444e43694578484f545432366f766e34396f573757714d37456539395361425453316a67706551585168746b6934787134384439636a31777a7358777a625674514d64414f6c717369502d494c30736c6d516456454153686a5a4c4b513552795739696e533941734d5449344e6e6c74387a4234515269665a355f75546e7a706c3350304f576c7837644e6a555f6533

4. 用例图

@startuml usecase-sample

!include https://unpkg.com/plantuml-style-c4@latest/core.puml

' uncomment the following line and comment the first to use locally

'!include core.puml

' 设置方向

LAYOUT_LEFT_RIGHT

'LAYOUT_TOP_DOWN

'LAYOUT_AS_SKETCH

actor customer

actor clerk

UserCasePackage("checkout","买单") {

customer -- (checkout)

(checkout) .> (payment) : include

(help) .> (checkout) : extends

(checkout) -- clerk

}

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f4e4f2d7a4a57393135384e78554f6868446133596965714c584f34575966343861494e36515a4350686b6e6378797643765954415a387a5765654b2d31683662714153487a4a355376385465442d555352717845524c68375a564335575253656b434e477961384a69687243326c395a5844477652486a4876414e4539744d585961574a6279696c654e4c4a6d623053443861786a3275496f633154626d6368573953624d6731717535413451714d61525a3876305365613066545a2d3144646e664f6c6a486d3166304764636842415469416b6a6f702d6468725f6c53712d4e2d51426e6f564d5172747248743749776e70376f534e66494a546362524b4c7a6d56394b565f6f56366b715869646d683145746b756d6e42666d6f38426e7267613270614f476350736e61715249766e47344e45507a574448306659626e76352d6d37375f464e6e5344704b38437831573352305758336736776d73632d716172305f58416863716d39624148676d46636635664b587748557075316b326a477063735f756c325342746e646835633256593256573030

5. 活动图

@startuml activity-new-sample

!include https://unpkg.com/plantuml-style-c4@latest/core.puml

' uncomment the following line and comment the first to use locally

'!include core.puml

GREEN_ARROW

start

:ClickServlet.handleRequest();

:new page;

if (Page.onSecurityCheck) then (true)

:Page.onInit();

if (isForward?) then (no)

:Process controls;

if (continue processing?) then (no)

stop

endif

if (isPost?) then (yes)

:Page.onPost();<

else (no)

:Page.onGet();

endif

:Page.onRender();

endif

else (false)

endif

if (do redirect?) then (yes)

:redirect process;

else

if (do forward?) then (yes)

:Forward request;

else (no)

:Render page template;

endif

endif

stop

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f524c42315a6a6957344274703554464a39655361627677534961737273677677514c56554775794c6d6b433450476f4b364a5241746e544378436749454c587576687437556d43643558716233474a515946736d536a79766c45724f33753547565242454b45654742594131637943586b4e307a787571563365367141786d546f76726d5070775649306b6f37386f466b302d76657675576b476d547130643831513774484676637448643845574a6a45625971525549797976304f575270484837567244356c7568776a557376554e64742d2d6a55736c74716766434f35676469635177706c36337142504e7838754f4f6a5f347839696a61564c763547477a3163466f6c516d55536b786c4e566c513542436350796c514178527569423148634232684f4179635756695878455a4941614c6a6b4e6c466a767178427645374553686578415944795953374a6b3964685749397441664d66534747654e625551703872434e596d726e30727a622d384d4e767052464378336c6f615a787670775a595f796c5348364169667774314e78365772792d54474d716b4f766e6d354c4462557173434d724c426e4d5264384d39643876654c6879744b636b506e37364e36746546537273366c76736d554c6d366e4e6c504868475469676b376e334f33573434574242696f464e704d455f39485f7161335f30303030

6. 其他组件

@startuml element

!include https://unpkg.com/plantuml-style-c4@latest/core.puml

' uncomment the following line and comment the first to use locally

'!include core.puml

actor actor

agent agent

artifact artifact

boundary boundary

card card

cloud cloud

component component

control control

database database

entity entity

file file

folder folder

frame frame

interface interface

node node

package package

queue queue

stack stack

rectangle rectangle

storage storage

usecase usecase

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f4c4f756e5269436d33344c746465415443594c5545644e414c48593954654a4766326a48413770784965786a65696c78337748345f376a6e6f627664474851554d48712d61575166615637666c66496c4f5159776c4150526937624f5842495f6c48505658515f58796f78614e376d38626c63736a3072536936667873592d58466e623734783656663144414b61524959465f4d4150546358684b6d59574b494d55356f4c6c59783271333142554436654161567330594b464f726a5a3856306d7766366f5969553065356f6e3075384f684c66397847595973635f54356752674d534a74314359454a736543317532683976796e4e56306338496e3071514a6f316456304d4563634e345a39374e456848615a64576667615234333557656c63585a7458455f41624e345a35367a3374305950577644456d64585173726c6b565f55344d5a5a716a646c32644a4e4d4d4e7531

C4 模型

1.System Context

@startuml system-context-diagram

!include https://unpkg.com/plantuml-style-c4@latest/c4_context.puml

' uncomment the following line and comment the first to use locally

'!include c4_context.puml

LAYOUT_WITH_LEGEND()

'LAYOUT_AS_SKETCH()

title System Context diagram for Internet Banking System

Actor(customer, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.")

System(banking_system, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")

System_Ext(mail_system, "E-mail system", "The internal Microsoft Exchange e-mail system.")

System_Ext(mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

Rel(customer, banking_system, "Uses")

Rel_Back(customer, mail_system, "Sends e-mails to")

Rel_Neighbor(banking_system, mail_system, "Sends e-mails", "SMTP")

Rel(banking_system, mainframe, "Uses")

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f564c3544526e656e3442746c6876586f574b58794e374267324b394e4a54494748654d6577636172633034695f42376f703152757a5f4b6b50576966705371556c5f56636c55536e326d51666843612d515154436a49424f59664a79554a49674e42645233394d74657a4157677034336267455857526556366e48593651647847646164543931584d4d6a71654e41484f4361396f395057784f746e552d71734f42475a4742553267735354453975794c346e576c34395a5a62637444563955464e6b555f46682d6a59582d46597155592d5679515f786f664e554e5454447143595f63745f42357a333745436a3559324550373568386d464f6430496b43636538736b305a70354b4e30617938316b356d71635239504462465a474b6e4d426a6e4a77713763626d4477585150374a7a4451395a6e43753879366c63717042594568334e69694d6f694869506531412d53653933706a74734d625052746249424259764868645f6b366573724b726f6b7578687364766873654473434f7a35715475314264744c4c416c337a54392d71787435374b363948716c3948703949763056664d544a63687644794b442d31735f7342633471747a6a33304a416c577351793579654651656a694771324d58705458416b744c696467424578376f2d614e346b465830333664446b4b794b316639666b3936745277357961624f32454b544d6d553244484a5438565032762d7a505f63747657756d594167553432726b7531557a7038646a2d384b6261357975686f4774636f4e4668705f71655f4f4a554250756c4b61534f6b5049636c545a49457a696b4f46

2. Container

@startuml container-diagram

!include https://unpkg.com/plantuml-style-c4@latest/c4_container.puml

' uncomment the following line and comment the first to use locally

'!include c4_container.puml

LAYOUT_TOP_DOWN

'LAYOUT_AS_SKETCH()

LAYOUT_WITH_LEGEND()

title Container diagram for Internet Banking System

Actor(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 registraion information, hased 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")

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f624c4a31526b43733442746841775266384c7630594c35574a707435694f71637370586e4c7a7663556e39367244576347663432454b684d4146686c3749676f50324b4252376b4a485a466c4652767672354c577a446e4b316649705a4467496c6f5772785a6e4d6f4b5f51416a454b31376c63456c6d77644a5173566a665441625444517543734a627134465859774b312d6c333338356467674655477a714d4b6a3753577744625036414230466c32525245364655597847774344303751346151566a475f6f7641303931434f664445514764465449746b43645478455f3768766979697433456279794644756476727258626b4e5078796c445f36526f75545a7055426b766f552d4d6c6f746c357239434d42435863315f6e65336b754946486d51766379394f50686a347a48524e4f384a354d4970314778467235444f3555484a73375546767444753557366a7372464b79586d32592d517a72324a33797759514d6b3049686436535a574a36515f382d524b4b496c4937595666356944786f647473306c6e4330364548454e675a38695177622d50344163444d727147665045746963664b5f755a3262616a4f5f514c745f454f737231485a2d425a3550514f45624c7854683953686b374d457676592d457672704348454d4f454447665339667a622d4d6c534b4d475f696352417776664a634462544f7a3337796a67785072724930334a632d6f6e52324b634b5a6152703851765644517348305075726e58376a47537542584e536c57566d7848504b686a4137455a624c79774a4e445671785841724f654a656f725744364c5059655844344b576266747a507374586452584e304c3349697252714c6a775963394a384d3632576b38526b435168395f685933714a69784a6f363674754564644778694b5158314d6d6262724d7574584a71364b4f7144787135764169636f4858464936326541304f70526f476b6e6b646e644b753767594d6d66466b634f725f4e6a7a734570534442635878634852705f6d397265596d34427a4a6e5f6a764a55554b384e517641346a3244706f4f594e6c745173412d316b6e4e68564751363262624e56315248634d747a4755784f7857544c39574a703078314745674f44676a6e7568554e44694a517a364f7577514c3546664a643357434d42593658704d645f4e4c44574a7451574572763176454a70734845565764336e566d4941344a6b63797263644b645a6b325f4b2d4345554b52315a5171554e7476465578476c4e5f6d4f776b4677495471586a53524a73645833336d51654b46634b467a7a444a7965376f56717863727a387a32316959467152764a3557367337664e6a4e2d5435772d50306832426f31746d7564656b6133746359487a6c4f6647395230327759444b4d4f6e306f496a6e386d786b7639615732316c66696a4c614271435a62715657755475436e78566f71532d5668776775747671663663796879326d3030

3.Component

组件图

@startuml component-diagram

!include https://unpkg.com/plantuml-style-c4@latest/c4_component.puml

' uncomment the following line and comment the first to use locally

'!include c4_component.puml

LAYOUT_WITH_LEGEND()

'LAYOUT_AS_SKETCH()

title Component diagram for Internet Banking System - API Application

Container(spa, "Single Page Application", "javascript and angular", "Provides all the internet banking functionality to customers via their web browser.")

Container(ma, "Mobile App", "Xamarin", "Provides a limited subset ot the internet banking functionality to customers via their mobile mobile device.")

ContainerDb(db, "Database", "Relational Database Schema", "Stores user registration information, hashed authentication credentials, access logs, etc.")

System_Ext(mbs, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

Container_Boundary(api, "API Application") {

Component(sign, "Sign In Controller", "MVC Rest Controlle", "Allows users to sign in to the internet banking system")

Component(accounts, "Accounts Summary Controller", "MVC Rest Controlle", "Provides customers with a summory of their bank accounts")

Component(security, "Security Component", "Spring Bean", "Provides functionality related to singing in, changing passwords, etc.")

Component(mbsfacade, "Mainframe Banking System Facade", "Spring Bean", "A facade onto the mainframe banking system.")

Rel(sign, security, "Uses")

Rel(accounts, mbsfacade, "Uses")

Rel(security, db, "Read & write to", "JDBC")

Rel(mbsfacade, mbs, "Uses", "XML/HTTPS")

}

Rel(spa, sign, "Uses", "JSON/HTTPS")

Rel(spa, accounts, "Uses", "JSON/HTTPS")

Rel(ma, sign, "Uses", "JSON/HTTPS")

Rel(ma, accounts, "Uses", "JSON/HTTPS")

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f665048444b2d44363438526c2d584b543369354b3052786941495543384f34447835423863752d4a67704c677630647065506555755258492d555f6636536b49334c4941675a7266724644457a70446c6a744a31344b466968303762525569546b4e584d51736d32736b383778504a665165394c5a32745f443972736864726b70614b75524773775445674375795247635666714f4a30496e7764776a316d496452555941387758536e416f3465327538645a6f6e6c59725457714f78475a47724e326d684746426f61463731434f684436504a37307965525f434e5478435f6c74765242372d5f4e546d697877765f6b56766f444a61665a6c6c6568356f4d6c72756c765a5349417741455863322d456d5f7a48474b666d41734235316e356b344a7464455a41334b556f5330517058726b4f6a5174483267467368595a6374614b4b7a5a335835615f586731497676377430586c513548784272357875576777335263322d41686b614358684a7034466f42686561315a53614e72706b3067575475346a7a49375a47775266385a676b466542474d36357574665a30776d66576767754454437556706550305f44396839784e73634a654c4239467a31597145776d4558586a545147516b416b4f386c5a75374a4773727a697a516468485957776d686766394e4b647a41756e4f384c44595549493373796f6d327145664c63476e78505248312d3871334734324450665a6f366558624252506c337735355641415169314545357069366d30674b397255715630666535423433434f74796139483951766a5a76564e56795539684a57505866387365414c4e4f7032497637787666736f4961693157713175464f454d784533674b595f6c45484c61396c6346434c65755365713742497a374c36334f4a52424b4b564a4c79486f566d4a6d3430756e31464d33536b7153623358585849666b3244654a6e627a785f44755034755a6b344b64514b6c53456966667251633543386c6f5f5478707269464a62764c375975623656696262397372476c79485a3734386e7235517778573231394f6946636e7764744e38393845395271324f4c315461423943445f4e42537051726847786837395537587a317945544b593349374c7348454a52666677324d6b3773664b4e636a475f727342543333356c6e346f6769774e7936324e7845596455575068307a33447872565231335a694436664367767a3245506c6c727833646e5a346555365f523539387a7552714e5979686c384e594a4e7932366939344b4956773376564e537874336b706261634d5643467a5a786b2d6344756c35476f645956756959515644464363454569695f62726f2d335258324468457942697a392d38396c7a4942384253644c64704e7930

4 Code

类图上面已经演示过了

5. 扩展图

@startuml system-context-extend-diagram

!include https://unpkg.com/plantuml-style-c4@latest/c4_context.puml

' uncomment the following line and comment the first to use locally

'!include c4_context.puml

'LAYOUT_TOP_DOWN

'LAYOUT_AS_SKETCH()

LAYOUT_WITH_LEGEND()

title System Landscape diagram for Big Bank plc

Actor(customer, "Personal Banking Customer", "A customer of the bank, with personal bank accounts.")

Enterprise_Boundary(c0, "Big Bank plc") {

System(banking_system, "Internet Banking System", "Allows customers to view information about their bank accounts, and make payments.")

System_Ext(atm, "ATM", "Allows customers to withdraw cash.")

System_Ext(mail_system, "E-mail system", "The internal Microsoft Exchange e-mail system.")

System_Ext(mainframe, "Mainframe Banking System", "Stores all of the core banking information about customers, accounts, transactions, etc.")

Person_Ext(customer_service, "Customer Service Staff", "Customer service staff within the bank.")

Person_Ext(back_office, "Back Office Staff", "Administration and support staff within the bank.")

}

Rel_Neighbor(customer, banking_system, "Uses")

Rel_R(customer, atm, "Withdraws cash using")

Rel_Back(customer, mail_system, "Sends e-mails to")

Rel_R(customer, customer_service, "Asks questions to", "Telephone")

Rel_D(banking_system, mail_system, "Sends e-mail using")

Rel_R(atm, mainframe, "Uses")

Rel_R(banking_system, mainframe, "Uses")

Rel_D(customer_service, mainframe, "Uses")

Rel_U(back_office, mainframe, "Uses")

Lay_D(atm, banking_system)

Lay_D(atm, customer)

Lay_U(mail_system, customer)

@enduml

687474703a2f2f7777772e706c616e74756d6c2e636f6d2f706c616e74756d6c2f706e672f564c46315269393634427478417750534759473846554a4b4b6f3257395965394b4932415568414d7a48596c4d452d77452d43474c464e566b736a69726f5247306e3878792d52445570465a317342586b436d727139344f79783671586c36526e5f773739586164496b6f536f414456623936774a31306f7665392d63716e414b2d6e74547a426361713842346e5a366e3455444f74645f65304b5a794b4a556e704e524e5537707147734b6e585661513157754771596a726c51577030777143575a32394431424171534352413461313673627146654f74524832706a635a632d4e71707a4e37396a7769746b4276776c4572334b704e795667466e55526e514e5752725137467679724a6c3570796c6459542d733334595a4e326b66653042427147616739306743727865477663515753704f565047513162354b79644d334d4c3952374471386e5979654944685841756d6d54395a64486c75763147513944597179685272673134533536544744394b58316139414d6e67636b75364e6a4a32436864324143397876513242535349585f7a4f4854434f44522d3369325735682d53376949343546727a4533646d364147367361726931384d3561326a4557684a5f62397530364d7976726f6d695752347266524c48664a68516e6e4c41796c35376734476e6e6e687348716e7955415258754270713668705367725a363446596e30366165436d7064314661476b645f783270367547744b636a58613241686f413349794145616973504858794971704f4e4f3873327375394432644a5566345a6678696656625f4f4c66686a5775395844524436674b464733746d327044684e4f757743734364333061504f46773542356a39666e6b6739334d4c435137784b5a3865516d754172675347683563617751325267533530384c45444c50647374376f52796f76523856556e4a54444a5776625f6d53675f6b6a704a3935543634526c51627163306f67416d5a677a742d49554174623737687758737352527463566f7570477a3279584b315f6a7831644b78636978754267577533496c4162444a586578553378357839366172327a7a6431576c6b5037586d6933646a415575417949414a596a7769396e65534f59696d4f52616c6450315f505f704e6b4974717956476c564f6b6b78786a445531796d6b7453474e7771497875365966515967446468384a722d5f54704a536c523446497937536c5450464a57705055765f585330

参考

C4 Model 的配色和实现大部分都是直接使用

https://github.com/RicardoNiepel/C4-PlantUML的,只有几个配色略有调整,并抽取出颜色的文件,可单独替换 c4_theme 以实现其他配色

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值