战术设计

环境准备,开发约定和架构说明

开发环境和技术选型

notion image

对象命名约定

notion image

架构选择

notion image
notion image
notion image
交易上下文局部框图
notion image

战术设计分析方法

交易域业务流程

售卖机扫码支付购物 战术分析

notion image

货柜机免密购物 战术分析

notion image
对应战术设计中的复杂交互,通过时序图描述
notion image

上下文交互图

notion image

代码搭建

代码搭建

实体和值对象

  • 实体: 主要由标识定义的对象被称作ENTITY
  • 值对象: 用于描述领域的某个方面而本身没有概念标识的对象称为值对象
需要以ID来跟踪状态变化的对象为实体,否则为值对象
notion image
 
notion image
notion image
库存商品值对象

领域对象构造

notion image
notion image
notion image
可以使用builder模式
notion image

资源库与持久化

notion image
notion image

聚合

notion image
notion image
notion image
notion image

领域服务

notion image
notion image

应用层

notion image
notion image
notion image
notion image
notion image

领域事件

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

事件风暴建模法

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image