I use simple Factory pattern, look at screen, please:
Factory pattern
As you can see I use switch operator to choose object and create instance.
But if there are over 100 classes? Problem is came. How to avoid switch construction? Using interface?
Aucun commentaire:
Enregistrer un commentaire