forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspecification.urm.puml
More file actions
106 lines (106 loc) · 2.37 KB
/
Copy pathspecification.urm.puml
File metadata and controls
106 lines (106 loc) · 2.37 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
@startuml
package com.iluwatar.specification.creature {
class Goblin {
+ Goblin()
}
interface Creature {
+ getColor() : Color {abstract}
+ getMovement() : Movement {abstract}
+ getName() : String {abstract}
+ getSize() : Size {abstract}
}
class Troll {
+ Troll()
}
abstract class AbstractCreature {
- color : Color
- movement : Movement
- name : String
- size : Size
+ AbstractCreature(name : String, size : Size, movement : Movement, color : Color)
+ getColor() : Color
+ getMovement() : Movement
+ getName() : String
+ getSize() : Size
+ toString() : String
}
class Shark {
+ Shark()
}
class KillerBee {
+ KillerBee()
}
class Octopus {
+ Octopus()
}
class Dragon {
+ Dragon()
}
}
package com.iluwatar.specification.property {
enum Color {
+ DARK {static}
+ GREEN {static}
+ LIGHT {static}
+ RED {static}
- title : String
+ toString() : String
+ valueOf(name : String) : Color {static}
+ values() : Color[] {static}
}
enum Movement {
+ FLYING {static}
+ SWIMMING {static}
+ WALKING {static}
- title : String
+ toString() : String
+ valueOf(name : String) : Movement {static}
+ values() : Movement[] {static}
}
enum Size {
+ LARGE {static}
+ NORMAL {static}
+ SMALL {static}
- title : String
+ toString() : String
+ valueOf(name : String) : Size {static}
+ values() : Size[] {static}
}
}
package com.iluwatar.specification.app {
class App {
+ App()
+ main(args : String[]) {static}
}
}
package com.iluwatar.specification.selector {
class SizeSelector {
- s : Size
+ SizeSelector(s : Size)
+ test(t : Creature) : boolean
}
class ColorSelector {
- c : Color
+ ColorSelector(c : Color)
+ test(t : Creature) : boolean
}
class MovementSelector {
- m : Movement
+ MovementSelector(m : Movement)
+ test(t : Creature) : boolean
}
}
SizeSelector --> "-s" Size
AbstractCreature --> "-color" Color
MovementSelector --> "-m" Movement
AbstractCreature --> "-movement" Movement
AbstractCreature --> "-size" Size
ColorSelector --> "-c" Color
Goblin --|> AbstractCreature
Troll --|> AbstractCreature
AbstractCreature ..|> Creature
Shark --|> AbstractCreature
KillerBee --|> AbstractCreature
Octopus --|> AbstractCreature
Dragon --|> AbstractCreature
@enduml