11@startuml
22package com . iluwatar . abstractfactory {
33 class App {
4+ - LOGGER : Logger {static}
45 - army : Army
56 - castle : Castle
67 - king : King
@@ -17,58 +18,58 @@ package com.iluwatar.abstractfactory {
1718 - setCastle(castle : Castle)
1819 - setKing(king : King)
1920 }
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
2531 }
2632 class ElfCastle {
2733 ~ DESCRIPTION : String {static}
2834 + ElfCastle ()
2935 + getDescription () : String
3036 }
31- class OrcCastle {
37+ class ElfKing {
3238 ~ DESCRIPTION : String {static}
33- + OrcCastle ()
39+ + ElfKing ()
3440 + getDescription () : String
3541 }
42+ class ElfKingdomFactory {
43+ + ElfKingdomFactory ()
44+ + createArmy () : Army
45+ + createCastle () : Castle
46+ + createKing () : King
47+ }
48+ interface King {
49+ + getDescription () : String {abstract }
50+ }
3651 interface KingdomFactory {
3752 + createArmy () : Army {abstract }
3853 + createCastle () : Castle {abstract }
3954 + createKing () : King {abstract }
4055 }
41- class ElfKing {
56+ class OrcArmy {
4257 ~ DESCRIPTION : String {static}
43- + ElfKing ()
58+ + OrcArmy ()
4459 + getDescription () : String
4560 }
46- class ElfArmy {
61+ class OrcCastle {
4762 ~ DESCRIPTION : String {static}
48- + ElfArmy ()
63+ + OrcCastle ()
4964 + getDescription () : String
5065 }
51- interface Castle {
52- + getDescription () : String {abstract }
53- }
54- interface Army {
55- + getDescription () : String {abstract }
56- }
5766 class OrcKing {
5867 ~ DESCRIPTION : String {static}
5968 + OrcKing ()
6069 + getDescription () : String
6170 }
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 ()
7273 + createArmy () : Army
7374 + createCastle () : Castle
7475 + createKing () : King
@@ -77,12 +78,12 @@ package com.iluwatar.abstractfactory {
7778App --> "- castle " Castle
7879App --> "- king " King
7980App --> "- army " Army
80- OrcKingdomFactory ..|> KingdomFactory
81+ ElfArmy ..|> Army
8182ElfCastle ..|> Castle
82- OrcCastle ..|> Castle
8383ElfKing ..|> King
84- ElfArmy ..|> Army
85- OrcKing ..|> King
86- OrcArmy ..|> Army
8784ElfKingdomFactory ..|> KingdomFactory
85+ OrcArmy ..|> Army
86+ OrcCastle ..|> Castle
87+ OrcKing ..|> King
88+ OrcKingdomFactory ..|> KingdomFactory
8889@enduml
0 commit comments