PC Review


Reply
Thread Tools Rate Thread

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

 
 
Tony Johansson
Guest
Posts: n/a
 
      4th Feb 2011
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


 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      4th Feb 2011
On 03-02-2011 19:53, Tony Johansson wrote:
> 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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inheritance like Animal : List<Animal> Tony Johansson Microsoft C# .NET 7 21st Feb 2010 05:28 PM
interface as parameter, and concrete class in method peter Microsoft C# .NET 3 18th Jan 2007 10:04 AM
What is the difference between type and class ad Microsoft C# .NET 4 24th Jan 2005 04:50 PM
How can I set properties of the concrete class while programming against interfaces? Julia Microsoft C# .NET 3 19th Dec 2004 04:13 PM
Help with desrialization of a concrete class Julia Microsoft C# .NET 4 30th Oct 2004 04:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:55 PM.