Closed yhay81 closed 3 years ago
And one question, why don't you use parent class? It can force to have same methods, so we can do polymorphism in a safe way.
I know delegation is better than inheritance in many cases, but in this case I think the parent class Pet
is good to be here.
After reading #366, I think it is not necessary to add more types of things but it can be more clear.
2 Points.
1. I think abstract factory can offer a concrete factory which can provide some different things from input/choice. Then how about change show_pet() into something which can accept args like
name
?2. abstract factory should have
abstract_factory
,concrete_factory
andproducts
. And in former abstract_factory.pyproducts is not clear. So I returned Pet Object to make more clear what product is.