From 7effd99f0d6ca55e57f7a0864211f9bc984c6e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 23 Mar 2025 10:29:30 +0200 Subject: [PATCH] docs: update abstract factory readme --- abstract-factory/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/abstract-factory/README.md b/abstract-factory/README.md index 7ec0d60bc..ee9823a39 100644 --- a/abstract-factory/README.md +++ b/abstract-factory/README.md @@ -36,6 +36,10 @@ Wikipedia says > The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes +Class diagram + +![Abstract Factory class diagram](./etc/abstract-factory.urm.png "Abstract Factory class diagram") + ## Programmatic Example of Abstract Factory in Java 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: 07:35:46.343 [main] INFO com.iluwatar.abstractfactory.App -- This is the orc king! ``` -## Abstract Factory Pattern Class Diagram - -![Abstract Factory](./etc/abstract-factory.urm.png "Abstract Factory class diagram") - ## When to Use the Abstract Factory Pattern in Java Use the Abstract Factory pattern in Java when: