Skip to content

Commit 7effd99

Browse files
committed
docs: update abstract factory readme
1 parent 770a85e commit 7effd99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

abstract-factory/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Wikipedia says
3636

3737
> The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes
3838
39+
Class diagram
40+
41+
![Abstract Factory class diagram](./etc/abstract-factory.urm.png "Abstract Factory class diagram")
42+
3943
## Programmatic Example of Abstract Factory in Java
4044

4145
To create a kingdom using the Abstract Factory pattern in Java, we need objects with a common theme. The elven kingdom needs an elven king, elven castle, and elven army whereas the orcish kingdom needs an orcish king, orcish castle, and orcish army. There is a dependency between the objects in the kingdom.
@@ -165,10 +169,6 @@ The program output:
165169
07:35:46.343 [main] INFO com.iluwatar.abstractfactory.App -- This is the orc king!
166170
```
167171

168-
## Abstract Factory Pattern Class Diagram
169-
170-
![Abstract Factory](./etc/abstract-factory.urm.png "Abstract Factory class diagram")
171-
172172
## When to Use the Abstract Factory Pattern in Java
173173

174174
Use the Abstract Factory pattern in Java when:

0 commit comments

Comments
 (0)