Skip to content

Commit ca58fa3

Browse files
committed
iluwatar#590 add related patterns to Abstract Factory
1 parent fa3b93b commit ca58fa3

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎abstract-factory/README.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ objects without specifying their concrete classes.
2121

2222
Real world example
2323

24-
> To create a kingdom we need objects with common theme. Elven kingdom needs an Elven king, Elven castle and Elven army whereas Orcish kingdom needs an Orcish king, Orcish castle and Orcish army. There is a dependency between the objects in the kingdom.
24+
> To create a kingdom we need objects with a common theme. Elven kingdom needs an Elven king, Elven castle and Elven army whereas Orcish kingdom needs an Orcish king, Orcish castle and Orcish army. There is a dependency between the objects in the kingdom.
2525
2626
In plain words
2727

@@ -33,7 +33,8 @@ Wikipedia says
3333
3434
**Programmatic Example**
3535

36-
Translating the kingdom example above. First of all we have some interfaces and implementation for the objects in the kingdom
36+
Translating the kingdom example above. First of all we have some interfaces and implementation for the objects in the
37+
kingdom.
3738

3839
```java
3940
public interface Castle {
@@ -188,9 +189,9 @@ Use the Abstract Factory pattern when
188189
* When you need consistency among products
189190
* You don’t want to change existing code when adding new products or families of products to the program.
190191

191-
## Use Cases:
192+
Example use cases
192193

193-
* Selecting to call the appropriate implementation of FileSystemAcmeService or DatabaseAcmeService or NetworkAcmeService at runtime.
194+
* Selecting to call to the appropriate implementation of FileSystemAcmeService or DatabaseAcmeService or NetworkAcmeService at runtime.
194195
* Unit test case writing becomes much easier
195196
* UI tools for different OS
196197

@@ -204,13 +205,17 @@ Use the Abstract Factory pattern when
204205

205206
* [Abstract Factory Pattern Tutorial](https://www.journaldev.com/1418/abstract-factory-design-pattern-in-java)
206207

207-
208-
## Real world examples
208+
## Known uses
209209

210210
* [javax.xml.parsers.DocumentBuilderFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/parsers/DocumentBuilderFactory.html)
211211
* [javax.xml.transform.TransformerFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/transform/TransformerFactory.html#newInstance--)
212212
* [javax.xml.xpath.XPathFactory](http://docs.oracle.com/javase/8/docs/api/javax/xml/xpath/XPathFactory.html#newInstance--)
213213

214+
## Related patterns
215+
216+
[Factory Method](https://java-design-patterns.com/patterns/factory-method/)
217+
[Factory Kit](https://java-design-patterns.com/patterns/factory-kit/)
218+
214219
## Credits
215220

216221
* [Design Patterns: Elements of Reusable Object-Oriented Software](https://www.amazon.com/gp/product/0201633612/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0201633612&linkCode=as2&tag=javadesignpat-20&linkId=675d49790ce11db99d90bde47f1aeb59)

0 commit comments

Comments
 (0)