mercredi 11 septembre 2019

What is the motivation of using factory method pattern rather than simple factory

what makes me confused is that this article says that the motivation of using factory method over the simple factory To override Open closed principle violation (Check Problem with Simple Factory Pattern section [here]: https://www.codeproject.com/Articles/1131770/Factory-Patterns-Simple-Factory-Pattern ) but in the head first design patterns book the example still violates the open closed principle as in the image in this link https://i.imgur.com/jLPwDo9.png

so what is the benefits of using factory method over simple factory ?

Aucun commentaire:

Enregistrer un commentaire