栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

C4-Model Container

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

C4-Model Container

本文章描述基于 C4-Model + PlantUML + VSCode 开发设计软件架构,相关环境搭建参看:C4-Model 开发环境搭建

Container
  • 1. Container
  • 2. ContainerDb
  • 3. ContainerQueue
  • 4. Container_Ext
  • 5. ContainerDb_Ext
  • 6. ContainerQueue_Ext
  • 7. Container_Boundary
  • 8. AddContainerTag
  • 9. AddExternalContainerTag
  • 10. 代码示例

1. Container

函数名Container($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数
alias(必须)定义Person的一个别名,用于后续设计的调用
label(必须)用于定义在图形上显示的标签, 可以使用字符串,也可以直接输入
techn为容器增加技术栈,如 [C/C++] [JS/TS]
descr增加对Container的详细描述
sprite为容器增加图标,C4 容器默认无图标
tags增加一个自定义的 tag, 默认tag为 Container
link增加一个链接,实现点击跳转的功能

2. ContainerDb

函数名ContainerDb($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数参见:Container

3. ContainerQueue

函数名ContainerQueue($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数参见:Container

4. Container_Ext

函数名Container_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数参见:Container

5. ContainerDb_Ext

函数名ContainerDb_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数参见:Container

6. ContainerQueue_Ext

函数名ContainerQueue_Ext($alias, $label, $techn="", $descr="", $sprite="", $tags="", $link="")
参数参见:Container

7. Container_Boundary

函数名Container_Boundary($alias, $label, $tags="", $link="")
参数参见:Container

8. AddContainerTag

函数名AddContainerTag ( $tagStereo, $bgColor=$CONTAINER_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$CONTAINER_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="")
参数
tagStereo(必须)设置一个标签的名称,用于后续的调用与显示,设置值为显示值
bgColor设置容器的背景颜色
fontColor设置容器的字体颜色
borderColor设置边框的颜色
shadowing是否显示阴影,true 或者 false
shape 为容器设置一个图标,
默认为直角
roundedBox 圆角
eightSided 斜角
sprite 设置一个图标
techn为容器增加一个技术栈,如果在容器定义中重新声明则显示容器中的定义
legendText设置在图例中显示的标题
legendSprite设置一个在图例中显示的图标,默认为上面参数sprite设置的图标

9. AddExternalContainerTag

函数名AddExternalContainerTag( $tagStereo, $bgColor=$CONTAINER_BG_COLOR, $fontColor=$ELEMENT_FONT_COLOR, $borderColor=$CONTAINER_BORDER_COLOR, $shadowing="", $shape="", $sprite="", $techn="", $legendText="", $legendSprite="")
参数参见:AddContainerTag

10. 代码示例
@startuml
' 定义宏 RELATIVE_INCLUDE 指定 C4-PlantUML 仓库
!define RELATIVE_INCLUDE /Users/xxx/C4-PlantUML
!include RELATIVE_INCLUDE/C4_Container.puml
' 引用 office 标准裤,扩展图标
' https://github.com/plantuml/plantuml-stdlib/tree/master/office
!include 
!include  
!include 
!include 
' 隐藏标签
HIDE_STEREOTYPE()
AddContainerTag("云端", $shadowing=true, $sprite="cloud", $shape="roundedBox", $techn="mysql", $legendText="云",$legendSprite="")
AddContainerTag("APP服务器", $shadowing=true, $sprite="application_server", $shape="roundedBox", $techn="Java", $legendText="APP服务器",$legendSprite="")
AddContainerTag("第三方服务器", $shadowing=true, $bgColor=$EXTERNAL_CONTAINER_BG_COLOR, $sprite="3rd_party_mail_server", $shape="roundedBox", $techn="Java", $legendText="第三方服务器",$legendSprite="")
AddContainerTag("客户端应用", $shadowing=true, $sprite="my_site", $shape="", $techn="C/C++", $legendText="客户端",$legendSprite="")

ContainerDb(cloud, "云端", $descr="数据备份与存储", $tags="云端")
Container_Boundary(server, "本地服务器"){
    Container(server_app, "APP服务器",, $descr="APP1的服务器", $tags="APP服务器")
    ContainerQueue(app_Queue, "APP数据队列服务器",, $descr="APP1的服务器", $tags="APP服务器")
}
Container_Ext(3rd_app_server, "第三方服务器",, $descr="第三方服务器,提供第三方功能支持", $tags="第三方服务器")
Container(pc_app, "电脑应用程序",, $descr="客户交互界面", $tags="客户端应用")
Rel_Neighbor(cloud, 3rd_app_server, "备份数据", "http/RestAPI")
BiRel_U(server_app, cloud, "获取云端数据", "http/RestAPI")
BiRel_U(pc_app, server_app, "获取服务器数据", "http/RestAPI")
Rel_U(pc_app, 3rd_app_server, "获取数据", "http/RestAPI")
Rel_R(server_app, app_Queue,"数据队列","FIFO")
SHOW_LEGEND()
@enduml

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/308186.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号