Skip to content

Commit

Permalink
Merge pull request iluwatar#575 from prafful1/master
Browse files Browse the repository at this point in the history
Few additions in README
  • Loading branch information
iluwatar authored May 21, 2017
2 parents 4d6467e + fb26d42 commit 1bbc597
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions abstract-factory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ Use the Abstract Factory pattern when
* a system should be configured with one of multiple families of products
* a family of related product objects is designed to be used together, and you need to enforce this constraint
* you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations
* the lifetime of the dependency is conceptually shorter than the lifetime of the consumer.
* you need a run-time value to construct a particular dependency
* you want to decide which product to call from a family at runtime.
* you need to supply one or more parameters only known at run-time before you can resolve a dependency.

## Use Cases:

* Selecting to call the appropriate implementation of FileSystemAcmeService or DatabaseAcmeService or NetworkAcmeService at runtime.
* Unit test case writing becomes much easier

## Consequences:

* Dependency injection in java hides the service class dependencies that can lead to runtime errors that would have been caught at compile time.




## Real world examples

Expand Down

0 comments on commit 1bbc597

Please sign in to comment.