forked from feixiao/DesignPattern
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayers.urm.puml
More file actions
126 lines (126 loc) · 3.65 KB
/
layers.urm.puml
File metadata and controls
126 lines (126 loc) · 3.65 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
@startuml
package com.iluwatar.layers {
class App {
- cakeBakingService : CakeBakingService {static}
+ App()
- initializeData(cakeBakingService : CakeBakingService) {static}
+ main(args : String[]) {static}
}
class Cake {
- id : Long
- layers : Set<CakeLayer>
- topping : CakeTopping
+ Cake()
+ addLayer(layer : CakeLayer)
+ getId() : Long
+ getLayers() : Set<CakeLayer>
+ getTopping() : CakeTopping
+ setId(id : Long)
+ setLayers(layers : Set<CakeLayer>)
+ setTopping(topping : CakeTopping)
+ toString() : String
}
interface CakeBakingService {
+ bakeNewCake(CakeInfo) {abstract}
+ getAllCakes() : List<CakeInfo> {abstract}
+ getAvailableLayers() : List<CakeLayerInfo> {abstract}
+ getAvailableToppings() : List<CakeToppingInfo> {abstract}
+ saveNewLayer(CakeLayerInfo) {abstract}
+ saveNewTopping(CakeToppingInfo) {abstract}
}
class CakeBakingServiceImpl {
- context : AbstractApplicationContext
+ CakeBakingServiceImpl()
+ bakeNewCake(cakeInfo : CakeInfo)
+ getAllCakes() : List<CakeInfo>
- getAvailableLayerEntities() : List<CakeLayer>
+ getAvailableLayers() : List<CakeLayerInfo>
- getAvailableToppingEntities() : List<CakeTopping>
+ getAvailableToppings() : List<CakeToppingInfo>
+ saveNewLayer(layerInfo : CakeLayerInfo)
+ saveNewTopping(toppingInfo : CakeToppingInfo)
}
interface CakeDao {
}
class CakeInfo {
+ cakeLayerInfos : List<CakeLayerInfo>
+ cakeToppingInfo : CakeToppingInfo
+ id : Optional<Long>
+ CakeInfo(cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List<CakeLayerInfo>)
+ CakeInfo(id : Long, cakeToppingInfo : CakeToppingInfo, cakeLayerInfos : List<CakeLayerInfo>)
+ calculateTotalCalories() : int
+ toString() : String
}
class CakeLayer {
- cake : Cake
- calories : int
- id : Long
- name : String
+ CakeLayer()
+ CakeLayer(name : String, calories : int)
+ getCake() : Cake
+ getCalories() : int
+ getId() : Long
+ getName() : String
+ setCake(cake : Cake)
+ setCalories(calories : int)
+ setId(id : Long)
+ setName(name : String)
+ toString() : String
}
interface CakeLayerDao {
}
class CakeLayerInfo {
+ calories : int
+ id : Optional<Long>
+ name : String
+ CakeLayerInfo(id : Long, name : String, calories : int)
+ CakeLayerInfo(name : String, calories : int)
+ toString() : String
}
class CakeTopping {
- cake : Cake
- calories : int
- id : Long
- name : String
+ CakeTopping()
+ CakeTopping(name : String, calories : int)
+ getCake() : Cake
+ getCalories() : int
+ getId() : Long
+ getName() : String
+ setCake(cake : Cake)
+ setCalories(calories : int)
+ setId(id : Long)
+ setName(name : String)
+ toString() : String
}
interface CakeToppingDao {
}
class CakeToppingInfo {
+ calories : int
+ id : Optional<Long>
+ name : String
+ CakeToppingInfo(id : Long, name : String, calories : int)
+ CakeToppingInfo(name : String, calories : int)
+ toString() : String
}
class CakeViewImpl {
- LOGGER : Logger {static}
- cakeBakingService : CakeBakingService
+ CakeViewImpl(cakeBakingService : CakeBakingService)
+ render()
}
interface View {
+ render() {abstract}
}
}
CakeViewImpl --> "-cakeBakingService" CakeBakingService
CakeInfo --> "-cakeToppingInfo" CakeToppingInfo
CakeInfo --> "-cakeLayerInfos" CakeLayerInfo
App --> "-cakeBakingService" CakeBakingService
CakeLayer --> "-cake" Cake
Cake --> "-topping" CakeTopping
CakeBakingServiceImpl ..|> CakeBakingService
CakeViewImpl ..|> View
@enduml