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

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
 
A

Arne Vajhøj

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top