I'm not sure I follow you. Are you saying that we could create Beagle and GermanShepherd as subclasses of Dog? That's true, but I don't see how that would change the situation much.
Can you clarify, or give an example where a factory class makes more sense than a function?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'm not sure I follow you. Are you saying that we could create
Beagle
andGermanShepherd
as subclasses ofDog
? That's true, but I don't see how that would change the situation much.Can you clarify, or give an example where a factory class makes more sense than a function?