September 2016
Intermediate to advanced
775 pages
18h 22m
English
Now that you have learned the Factory method and Abstract Factory method, let's see the comparison of the two:
|
Factory method |
Abstract Factory method |
|---|---|
|
This exposes a method to the client to create the objects |
Abstract Factory method contains one or more factory methods to create a family of related objects |
|
This uses inheritance and subclasses to decide which object to create |
This uses composition to delegate responsibility to create objects of another class |
|
The factory method is used to create one product |
Abstract Factory method is about creating families of related products |
Read now
Unlock full access