C# - Program organization and elementary template

Jan 12 2009 7:59 PM

I imagine a zoo with lots of animals. To deal with their info I organized them somehow.

They all: 

Sleep xx hrs / day. 
Eat food xx Kg / week.

Some of them: 

bellow, cheep, howl or whatever.

are he and some are she.

are covered by feathers, leather, bristles or ... 

have names like "Jack", "Tweety", "Pirate" or no name at all. 

walk, run, fly or ...


I would like to be able to do, as an example: 

Compare some felines with some birds to see how much more food each one eats per month. 

For a specific type, let's say siamese cats, to know they gender and names if any. 

 What type of cow sleeps more hours / month. 

 That is, I need, in some cases to pass / retrieve numeric data, so some of the classes are not all static.

My comments: 

I am not asking for code, of course. It is that I find difficult to organize in my mind kind of a template more or less complete and somehow more complex than most of the examples allow to expect (given online by Microsoft, I mean). 

 I realized that once I grasp how to organize namespaces and classes, I could walk faster by myself. 

 I am learning just by reading online. Tutorials put their accent in this or that but it seems that what I am asking here is almost taken for granted. 

 I have no previous experience with C, C++. Just that old BASIC from 25 years ago and assembler for PIC micros which I write fluently.

My questions:

a) Is this organization reasonable (classes inside classes inside classes), or there is a better way to work with this? 

b) Could be that I would need another namespace besides this one only? Maybe two, three or more? (Totally clueless about that!) 

c) Where should I locate Main? Inside the class XXXX_catalogue or...? 

 d) Am I too off subject, maybe?


Code:

namespace The_zoo_next_door
{
    class MaybeIncongruent_animals_catalogue
    {
        class bovine
        {
            class Angus
            { }
            class Hereford
            { }
            class Holando
            { }
        }
        class feline
        {
            class domestic
            {
                class siamese
                { }
                class maltese
                { }
            }
            class wild
            {
                class tiger
                { }
                class bobcat
                { }
                class cheetah
                { }
            }
        }
        class birds
        {
            class domestic
            {
                class chicken
                { }
                class goose
                { }
                class canary
                { }
            }
            class wild
            {
                class robin
                { }
                class condor
                { }
                class falcon
                { }
            }
        }
        // Is this the right place?
        static void Main(string[] args)
        { }
    }
}


Answers (4)