What will the difference be if I put the foodlist in the Animal class to having it in the concrete a

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
T

Tony Johansson

Hello!
I just wonder each animal have a foodList<FoodItem> that I pass from the GUI
class that contains the food that the animal like.
At the moment I have stored that in the Animal class it might be better to
store that in the actual animal type class like Cat, Dog and so on.

What will the difference be if I compare having the foodlist in the Animal
class to having the foodlist in the concrete animal type class(Cat,Dog) ?

//Tony
 
I just wonder each animal have a foodList<FoodItem> that I pass from the GUI
class that contains the food that the animal like.
At the moment I have stored that in the Animal class it might be better to
store that in the actual animal type class like Cat, Dog and so on.

What will the difference be if I compare having the foodlist in the Animal
class to having the foodlist in the concrete animal type class(Cat,Dog) ?

If all Animal sub classes will have it then it do belong
in Animal.

But maybe the value adding belongs in the sub classes.

Arne
 
Back
Top