-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathstrategy.urm.puml
37 lines (37 loc) · 893 Bytes
/
strategy.urm.puml
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
@startuml
package com.iluwatar.strategy {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
class DragonSlayer {
- strategy : DragonSlayingStrategy
+ DragonSlayer(strategy : DragonSlayingStrategy)
+ changeStrategy(strategy : DragonSlayingStrategy)
+ goToBattle()
}
interface DragonSlayingStrategy {
+ execute() {abstract}
}
class MeleeStrategy {
- LOGGER : Logger {static}
+ MeleeStrategy()
+ execute()
}
class ProjectileStrategy {
- LOGGER : Logger {static}
+ ProjectileStrategy()
+ execute()
}
class SpellStrategy {
- LOGGER : Logger {static}
+ SpellStrategy()
+ execute()
}
}
DragonSlayer --> "-strategy" DragonSlayingStrategy
MeleeStrategy ..|> DragonSlayingStrategy
ProjectileStrategy ..|> DragonSlayingStrategy
SpellStrategy ..|> DragonSlayingStrategy
@enduml