forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel-view-controller.urm.puml
More file actions
69 lines (69 loc) · 1.81 KB
/
Copy pathmodel-view-controller.urm.puml
File metadata and controls
69 lines (69 loc) · 1.81 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
@startuml
package com.iluwatar.model.view.controller {
class GiantModel {
- fatigue : Fatigue
- health : Health
- nourishment : Nourishment
~ GiantModel(health : Health, fatigue : Fatigue, nourishment : Nourishment)
+ getFatigue() : Fatigue
+ getHealth() : Health
+ getNourishment() : Nourishment
+ setFatigue(fatigue : Fatigue)
+ setHealth(health : Health)
+ setNourishment(nourishment : Nourishment)
+ toString() : String
}
class App {
+ App()
+ main(args : String[]) {static}
}
class GiantView {
+ GiantView()
+ displayGiant(giant : GiantModel)
}
class GiantController {
- giant : GiantModel
- view : GiantView
+ GiantController(giant : GiantModel, view : GiantView)
+ getFatigue() : Fatigue
+ getHealth() : Health
+ getNourishment() : Nourishment
+ setFatigue(fatigue : Fatigue)
+ setHealth(health : Health)
+ setNourishment(nourishment : Nourishment)
+ updateView()
}
enum Nourishment {
+ HUNGRY {static}
+ SATURATED {static}
+ STARVING {static}
- title : String
+ toString() : String
+ valueOf(name : String) : Nourishment {static}
+ values() : Nourishment[] {static}
}
enum Fatigue {
+ ALERT {static}
+ SLEEPING {static}
+ TIRED {static}
- title : String
+ toString() : String
+ valueOf(name : String) : Fatigue {static}
+ values() : Fatigue[] {static}
}
enum Health {
+ DEAD {static}
+ HEALTHY {static}
+ WOUNDED {static}
- title : String
+ toString() : String
+ valueOf(name : String) : Health {static}
+ values() : Health[] {static}
}
}
GiantModel --> "-nourishment" Nourishment
GiantController --> "-giant" GiantModel
GiantModel --> "-fatigue" Fatigue
GiantModel --> "-health" Health
GiantController --> "-view" GiantView
@enduml