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?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.