Click here to Skip to main content
15,884,892 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys,

this seems to be a trivial question, but it blows away my brain when i'm thought a lot about it.

IS-A category a list of things or HAS-A category a list of things?
Me and my co-worker aren't sure at all how to answer the question correctly.

After discussion we are thinking both is right but we aren't 100% sure.

I think it is right to say a category is like a box. You can put in some letters, close the box and put the box into a rack. So the box has letters of a category inside.
BUT
I think you could also argument that you put the letters on a stack and the stack is the category.

And the same thing with the rack.
The rack could have a list of boxes
BUT
The rack can consists of boxes

I know it's a little bit confusing.

But i hope someone could write down his perspective and point out why.
Posted

1 solution

IS-A denotes inheritance e.g. cat is-a animal.

HAS-A denotes composition e.g. cat has-a leg.
 
Share this answer
 
Comments
C3D1 3-Mar-15 5:39am    
Yes, i know this.
Did you read my question till the end?

The problem is what is the Category-Items-Relationship?
Mehdi Gholam 3-Mar-15 5:43am    
For isa to work both entities should be related so category and item are not unless you defined them to be.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900