• State diagrams: concurrent regions

    State diagrams: concurrent regions

    简介 / IntroductionA state machine often runs two independent things at once: an order is being paid for while the warehouse reserves stock, and the order only closes when both finish. If you ch...
  • 状态机:并发区域

    状态机:并发区域

    简介 / Introduction一个状态机里经常同时跑着两件互不干扰的事:订单在支付的同时也在备货,等两件事都完成才算结束。画状态图时,如果把两个阶段串成一条线,就丢掉了「同时发生」这个语义。PlantUML 用复合状态里的 -- 分隔线把一个状态拆成多个并发区域;Mermaid 官方并不支持分隔线,只能用 <<fork>> / <<...
  • ER diagrams: attributes and keys

    ER diagrams: attributes and keys

    简介 / IntroductionThe real payload of an ER diagram lives inside the entities: the attributes, and the primary / foreign / unique key constraints among them. Those constraints decide ...
  • ER 图:属性与键

    ER 图:属性与键

    简介 / IntroductionER 图里真正承载信息的是实体内部的属性,以及属性之间的主键、外键、唯一键等约束。这两种约束决定了表怎么建、关联怎么落。PlantUML 用 entity 块加 <<PK>> 之类的 stereotype 标注,Mermaid 则用 PK / FK / UK 关键字后缀。本文用同一份客户—订单—订单行模型...
  • Flowcharts: linkStyle interpolation

    Flowcharts: linkStyle interpolation

    简介 / IntroductionThe connectors in a flowchart are the most overlooked and most semantically loaded part of the drawing: when the happy path, the error path and the audit path all look the sam...
  • 流程图:linkStyle 链样式

    流程图:linkStyle 链样式

    简介 / Introduction流程图里的连线(link)是最容易被忽略、却最能传达语义的部分:主干路径、异常路径、审计路径如果全部长成一样,读者只能靠文字去猜哪条是主干。Mermaid 用 linkStyle 语句按下标给某一条边单独描边,PlantUML 则在箭头上内联颜色与线型。两者还有一个更隐蔽的差别:连线是直的、折的还是平滑曲线,由「插值方式」决定,Mermaid 里这...
  • Flowcharts: classDef styling

    Flowcharts: classDef styling

    简介 / IntroductionOnce a flowchart has more than a couple of branches, the “happy path” and the “failure path” start to look identical, and readers have to read every label to tell them apart. ...
  • 流程图:classDef 样式

    流程图:classDef 样式

    简介 / Introduction流程图一旦分支较多,”成功”和”失败”两条路径看上去就几乎一样,读者需要逐字读文字才能区分。给节点上色是最直接的办法。Mermaid 提供了 classDef 声明式写法,PlantUML 则用 <style> 块加 skinparam 组合实现,效果等价但语法完全不同。本文用同一个「参数校验」流程演示两种引擎的着色方案。 PlantU...
  • Sequence diagrams: critical regions

    Sequence diagrams: critical regions

    简介 / IntroductionSome steps in a sequence are “must succeed, otherwise the whole flow fails” — locking stock, debiting a balance, writing an audit log. That block is modelled as a critical reg...
  • 时序图:critical 临界区

    时序图:critical 临界区

    简介 / Introduction时序图里有一段流程是”必须成功,否则整体失败”的(比如锁定库存、扣减余额、写入审计日志),这段流程就用 critical 临界区 来表达:临界区内所有消息都必须执行完,一旦失败就跳到异常分支。它和 alt(二选一)、loop(循环)的区别在于失败即中断这个语义。 两个引擎都提供 critical,但配对的分支关键字不一样:PlantUML 用 op...
123456…33