提示8-7:记录(至少)(业务或领域)数据模型!

提示8-7:记录(至少)(业务或领域)数据模型!

#concept #domain #essential #plantUML

是的-我们知道DDD不仅仅是一个数据模型-数据是系统的核心,如果数据不正确,那么系统很可能会失败。

如果您没有创建和记录包含静态和动态方面的全面“领域驱动设计”模型,您至少应该创建和记录(业务或领域)数据模型。

这样的数据模型概述了系统的基本数据结构及其相关关系。

以下为简要示例(基于uml-diagrams.org的想法)。它缺乏对实体及其关系的定义或进一步解释……实际上,你应该更彻底……

1705190139584

PlantUML来源

上图是从以下PlantUML来源自动生成的:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

@startuml

interface Person {
title: String
lastName: String
firstname: String
birthData: Date
gender: Gender
postalAddress: Address
}

Person "1" -left- "1..*" Phone

Person <|-- Patient
Person <|-- Staff

Person "*" --right-- "*" Hospital

class Hospital {
name: String
address: Address
}

class Department {
name: String
location: String
}


Department "*" -down-* "1" Hospital
Department "1" -- "1..*" Staff
(Department, Staff) -- Contract

Hospital --- "1..*" Phone

class Phone {
telNr: String
isPrivat: Boolean
}

class Staff {
joined: Date
education: String[]
certificate: String[]
languages: String[]
}

class Contract{
begin: Date
isUnlimited: Boolean
monthSalary: Float
contractType: ContractType

}

class Patient {
id: String {id}
name: String
aufgenommen: Date
allergie: String[]
aktuelleDiagnose: Diagnosis[]
}

Staff <|-down- MedicalStaff
Staff <|-down- AdministrativeStaff
Staff <|-down- TechnicalStaff


class MedicalStaff{
fachrichtung: String[]
approbation: Boolean

}

MedicalStaff -left- Patient

class AdministrativeStaff {
}

class TechnicalStaff {
}

@enduml