1
1
@startuml
2
2
package com . iluwatar . abstractfactory {
3
3
class App {
4
+ - LOGGER : Logger {static}
4
5
- army : Army
5
6
- castle : Castle
6
7
- king : King
@@ -17,58 +18,58 @@ package com.iluwatar.abstractfactory {
17
18
- setCastle(castle : Castle)
18
19
- setKing(king : King)
19
20
}
20
- class OrcKingdomFactory {
21
- + OrcKingdomFactory ()
22
- + createArmy () : Army
23
- + createCastle () : Castle
24
- + createKing () : King
21
+ interface Army {
22
+ + getDescription () : String {abstract }
23
+ }
24
+ interface Castle {
25
+ + getDescription () : String {abstract }
26
+ }
27
+ class ElfArmy {
28
+ ~ DESCRIPTION : String {static}
29
+ + ElfArmy ()
30
+ + getDescription () : String
25
31
}
26
32
class ElfCastle {
27
33
~ DESCRIPTION : String {static}
28
34
+ ElfCastle ()
29
35
+ getDescription () : String
30
36
}
31
- class OrcCastle {
37
+ class ElfKing {
32
38
~ DESCRIPTION : String {static}
33
- + OrcCastle ()
39
+ + ElfKing ()
34
40
+ getDescription () : String
35
41
}
42
+ class ElfKingdomFactory {
43
+ + ElfKingdomFactory ()
44
+ + createArmy () : Army
45
+ + createCastle () : Castle
46
+ + createKing () : King
47
+ }
48
+ interface King {
49
+ + getDescription () : String {abstract }
50
+ }
36
51
interface KingdomFactory {
37
52
+ createArmy () : Army {abstract }
38
53
+ createCastle () : Castle {abstract }
39
54
+ createKing () : King {abstract }
40
55
}
41
- class ElfKing {
56
+ class OrcArmy {
42
57
~ DESCRIPTION : String {static}
43
- + ElfKing ()
58
+ + OrcArmy ()
44
59
+ getDescription () : String
45
60
}
46
- class ElfArmy {
61
+ class OrcCastle {
47
62
~ DESCRIPTION : String {static}
48
- + ElfArmy ()
63
+ + OrcCastle ()
49
64
+ getDescription () : String
50
65
}
51
- interface Castle {
52
- + getDescription () : String {abstract }
53
- }
54
- interface Army {
55
- + getDescription () : String {abstract }
56
- }
57
66
class OrcKing {
58
67
~ DESCRIPTION : String {static}
59
68
+ OrcKing ()
60
69
+ getDescription () : String
61
70
}
62
- class OrcArmy {
63
- ~ DESCRIPTION : String {static}
64
- + OrcArmy ()
65
- + getDescription () : String
66
- }
67
- interface King {
68
- + getDescription () : String {abstract }
69
- }
70
- class ElfKingdomFactory {
71
- + ElfKingdomFactory ()
71
+ class OrcKingdomFactory {
72
+ + OrcKingdomFactory ()
72
73
+ createArmy () : Army
73
74
+ createCastle () : Castle
74
75
+ createKing () : King
@@ -77,12 +78,12 @@ package com.iluwatar.abstractfactory {
77
78
App --> "- castle " Castle
78
79
App --> "- king " King
79
80
App --> "- army " Army
80
- OrcKingdomFactory ..|> KingdomFactory
81
+ ElfArmy ..|> Army
81
82
ElfCastle ..|> Castle
82
- OrcCastle ..|> Castle
83
83
ElfKing ..|> King
84
- ElfArmy ..|> Army
85
- OrcKing ..|> King
86
- OrcArmy ..|> Army
87
84
ElfKingdomFactory ..|> KingdomFactory
85
+ OrcArmy ..|> Army
86
+ OrcCastle ..|> Castle
87
+ OrcKing ..|> King
88
+ OrcKingdomFactory ..|> KingdomFactory
88
89
@enduml
0 commit comments