写点什么

架构师训练营 - 命题作业 1

用户头像
水边
关注
发布于: 2020 年 06 月 07 日
架构师训练营-命题作业1

食堂就餐卡系统设计:

1、系统用例图:



2、组件图



3、组件时序图



4、部署图





注:基于PlantUML,代码如下:

1、用例图:



@startuml

left to right direction

actor "消费者" as xfz

actor "服务员" as fwy

actor "管理员" as gly

rectangle 食堂就餐卡系统 {

usecase "餐卡注册" as ckzc

usecase "餐卡信息获取" as xxhq

usecase "餐卡消费" as ckxf

usecase "统计报表" as sjtj

usecase "金额扣减" as jekj

}

xfz --> ckzc

xfz --> ckxf

fwy --> ckxf

ckxf --> xxhq : extend

ckxf --> jekj : extend

gly --> sjtj

@enduml



2、组件图:

@startuml

interface "餐卡注册" as ckzc

interface "餐卡消费" as ckxf

interface "统计报表" as tjbb

component "管理中心" as glzx

component "收款机" as skj

database "MySql" as db



ckzc --> glzx

ckxf --> skj

skj --> glzx

glzx --> db

tjbb --> glzx

@enduml



3、组件时序图

@startuml

actor "消费者" as xfz

actor "服务员" as fwy

actor "管理员" as gly

participant "收款机" as skj

participant "管理中心" as glzx



xfz -> gly: 1.餐卡注册

activate gly

gly -> glzx: 注册信息/金额输入

activate glzx

glzx --> gly

deactivate glzx

gly --> xfz : 餐卡交付

deactivate gly

deactivate glzx



xfz -> skj: 2.插卡消费

activate skj

skj -> glzx: 获取数据

activate glzx

glzx --> skj : 启动事务,返回数据

skj --> xfz: 展示余额

fwy -> skj: 消费金额输入

skj -> skj : 扣减

skj -> glzx: 同步数据

glzx --> skj: 完成扣减,结束事务

deactivate glzx

skj --> xfz : 展示余额

deactivate skj

deactivate glzx



gly -> glzx : 3.查看报表

glzx --> gly



@enduml



4、部署图



@startuml

actor "服务员1" as fwy1

actor "服务员2" as fwy2

actor "管理员" as gly

node "收款机1" as skj1

node "收款机2" as skj2

node "管理中心" as glzx

cloud "TCP/IP网络" as wl

database "MySQL" as db



fwy1 -> skj1

skj1 -> wl

fwy2 -> skj2

skj2 -> wl



glzx -> db

glzx <- gly

wl -> glzx



@enduml



发布于: 2020 年 06 月 07 日阅读数: 195
用户头像

水边

关注

还未添加个人签名 2019.04.14 加入

还未添加个人简介

评论

发布
暂无评论
架构师训练营-命题作业1