forked from iluwatar/java-design-patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprototype.urm.puml
More file actions
81 lines (81 loc) · 1.67 KB
/
Copy pathprototype.urm.puml
File metadata and controls
81 lines (81 loc) · 1.67 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
@startuml
package com.iluwatar.prototype {
interface HeroFactory {
+ createBeast() : Beast {abstract}
+ createMage() : Mage {abstract}
+ createWarlord() : Warlord {abstract}
}
class OrcBeast {
+ OrcBeast()
+ clone() : Beast
+ toString() : String
}
abstract class Mage {
+ Mage()
+ clone() : Mage {abstract}
}
class HeroFactoryImpl {
- beast : Beast
- mage : Mage
- warlord : Warlord
+ HeroFactoryImpl(mage : Mage, warlord : Warlord, beast : Beast)
+ createBeast() : Beast
+ createMage() : Mage
+ createWarlord() : Warlord
}
class ElfMage {
+ ElfMage()
+ clone() : Mage
+ toString() : String
}
abstract class Prototype {
+ Prototype()
+ clone() : Object {abstract}
}
class App {
+ App()
+ main(args : String[]) {static}
}
abstract class Warlord {
+ Warlord()
+ clone() : Warlord {abstract}
}
class OrcWarlord {
+ OrcWarlord()
+ clone() : Warlord
+ toString() : String
}
class ElfWarlord {
+ ElfWarlord()
+ clone() : Warlord
+ toString() : String
}
abstract class Beast {
+ Beast()
+ clone() : Beast {abstract}
}
class OrcMage {
+ OrcMage()
+ clone() : Mage
+ toString() : String
}
class ElfBeast {
+ ElfBeast()
+ clone() : Beast
+ toString() : String
}
}
HeroFactoryImpl --> "-beast" Beast
HeroFactoryImpl --> "-warlord" Warlord
HeroFactoryImpl --> "-mage" Mage
OrcBeast --|> Beast
Mage --|> Prototype
HeroFactoryImpl ..|> HeroFactory
ElfMage --|> Mage
Warlord --|> Prototype
OrcWarlord --|> Warlord
ElfWarlord --|> Warlord
Beast --|> Prototype
OrcMage --|> Mage
ElfBeast --|> Beast
@enduml