jeudi 7 mars 2019

Differences between two types of Factory Patterns

I am designing factory patterns for a game and I have this two options:

  1. create an abstract Factory class and derived factory classes

  2. create only 1 Factory class, which will be the instantiation of all Entity types

What are the advantages/disadvantages of each? For option 1, it is a lot easier for me as a programmer since I have so many types of entities, although option 2 has better polymorphism. Why would one choose option 2 instead?

Aucun commentaire:

Enregistrer un commentaire