jeudi 6 juin 2019

Does factory method pattern follow template pattern, and abstract factory pattern doesn't?

In Design Pattern by Gamma et al, "Factory Method" has the following structure:

enter image description here

"Abstract Factory" has the following structure:

enter image description here

In Factory Method, why does Creator has a method AnOperation() to callFactoryMethod(), while AbstractFactory doesn't have a method to call CreateProductA() and CreateProductB()?

Does Creator's method AnOperation() callingFactoryMethod() follow the "Template" pattern?

enter image description here

Aucun commentaire:

Enregistrer un commentaire