In most factory's pattern explanation topics, we are told that factories are needed to refuse using new
for for instantiating objects. Instead it we need to instantiate factories with new
, that do new
for concrete objects for us.
But why? In that case we just have excess middle class. For example here
In my code I use this way. Is it factory? Is it right way? PasteBin
P.S. Excuse me for my english
Aucun commentaire:
Enregistrer un commentaire