You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ca58fa3
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: abstract-factory/README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ objects without specifying their concrete classes.
21
21
22
22
Real world example
23
23
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.
25
25
26
26
In plain words
27
27
@@ -33,7 +33,8 @@ Wikipedia says
33
33
34
34
**Programmatic Example**
35
35
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.
37
38
38
39
```java
39
40
publicinterfaceCastle {
@@ -188,9 +189,9 @@ Use the Abstract Factory pattern when
188
189
* When you need consistency among products
189
190
* You don’t want to change existing code when adding new products or families of products to the program.
190
191
191
-
## Use Cases:
192
+
Example use cases
192
193
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.
194
195
* Unit test case writing becomes much easier
195
196
* UI tools for different OS
196
197
@@ -204,13 +205,17 @@ Use the Abstract Factory pattern when
*[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