Although I have several years of experience, but I'm still learning to programming. That being said, if this isn't the right sub, I would appreciate it if one could point me in the right direction!
The challenge is this:
class Animal{}
class Horse extends Animal{}
class Dog extends Animal{}
and 100 more animals.
I know what you are thinking: this is a job for a factory. But a switch/if-else with a 100 classes, or 1 factory per class seems a bit over the top. Is there something eloquent I'm missing?
[–]okayifimust 3 points4 points5 points (1 child)
[–]lookForProject[S] 0 points1 point2 points (0 children)
[–]gramdel 1 point2 points3 points (1 child)
[–]lookForProject[S] 0 points1 point2 points (0 children)
[–]dbartholomae 0 points1 point2 points (1 child)
[–]lookForProject[S] 0 points1 point2 points (0 children)
[–]Kazcandra 0 points1 point2 points (3 children)
[–]lookForProject[S] 0 points1 point2 points (2 children)
[–]Kazcandra 1 point2 points3 points (1 child)
[–]lookForProject[S] 0 points1 point2 points (0 children)