forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfactory-kit.urm.puml
More file actions
46 lines (46 loc) · 897 Bytes
/
factory-kit.urm.puml
File metadata and controls
46 lines (46 loc) · 897 Bytes
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
@startuml
package com.iluwatar.factorykit {
class App {
- LOGGER : Logger {static}
+ App()
+ main(args : String[]) {static}
}
class Axe {
+ Axe()
+ toString() : String
}
class Bow {
+ Bow()
+ toString() : String
}
interface Builder {
+ add(WeaponType, Supplier<Weapon>) {abstract}
}
class Spear {
+ Spear()
+ toString() : String
}
class Sword {
+ Sword()
+ toString() : String
}
interface Weapon {
}
interface WeaponFactory {
+ create(WeaponType) : Weapon {abstract}
+ factory(consumer : Consumer<Builder>) : WeaponFactory {static}
}
enum WeaponType {
+ AXE {static}
+ BOW {static}
+ SPEAR {static}
+ SWORD {static}
+ valueOf(name : String) : WeaponType {static}
+ values() : WeaponType[] {static}
}
}
Axe ..|> Weapon
Bow ..|> Weapon
Spear ..|> Weapon
Sword ..|> Weapon
@enduml