Wednesday, October 28, 2015

Abstract Factory

The Abstract Factory Pattern is to let an object manage the creation of the objects. It is often mixed up with Factory Method Pattern. The difference is that Factory Method delegates this role to a method. In a way, we can say that Abstract Factory Pattern implements Factory Method.

So what's the difference with a Factory Method pattern :

* To modify the factory of an client object we should :
** override (or inherit and implement) the factory method with Factory Method pattern
** instanciate the new factory in the client object with Abstract Factory Method

0 comments:

Post a Comment