add Abstract Factory

This commit is contained in:
Jakub Vojvoda
2016-09-07 09:17:49 +02:00
parent 06c94979d1
commit af189c7a85
3 changed files with 38 additions and 17 deletions

View File

@@ -1,6 +1,16 @@
## Abstract Factory
Abstract factory pattern has creational purpose and provides an interface for creating families of related or dependent objects without specifying their concrete classes.
Pattern applies to classes where deals with relationships through inheritence ie. they are static-fixed at compile time.
Abstract factory pattern has creational purpose and provides an interface for
creating families of related or dependent objects without specifying their
concrete classes. Pattern applies to object and deal with object relationships,
which are more dynamic. In contrast to Factory Method, Abstract Factory pattern
produces family of types that are related, ie. it has more than one method of
types it produces.
### When to use
* a system should be independent of how its products are created, composed, and represented
* a system should be configured with one of multiple families of products
* a family of related product objects is designed to be used together
* you want to provide a class library of products, and you want to reveal just their interfaces, not their implementations