I am new to design patterns and I just caught a grasp to the factory patterns, I was wondering when is it advised or when should I know that I should use abstract factory pattern? I get it works when I have a family of products that I need to be created with each other in certain styles (or sub-classing). But this may be a disadvantage; having the abstract factory worrying about each product and if this family was to be changed (added or removed a product) wouldn't that make the abstract factory harder to manage Can't I just define an abstraction to relate that family of products with each other instead and have the factory working with one product (in this case it's a complex product, maybe have a builder pattern instead)
Aucun commentaire:
Enregistrer un commentaire