October 2018
Intermediate to advanced
370 pages
9h 15m
English
The abstract factory pattern works in a similar way to the factory method, but it's used for complex cases. According to this pattern, we have a factory that generates other factories. The following diagram illustrates types of hierarchy:

This diagram contains the MercedesFactory and HondaFactory classes, which implement the CarFactory interface. The FactoryProducer class contains the produceFactory method, which returns a new instance of the CarFactory type. The CarFactory interface, in turn, contains the createCar method, which returns an instance of the Car type. The Car interface is extended by the Mercedes and Honda
Read now
Unlock full access