| Author |
How to decide whether use IS A or HAS A Relation
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Assume that i have a above class , by which parameters should we decide what to use ?? Whether is a or Has a Relation ??
HAS - A
|
Save India From Corruption - Anna Hazare.
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12928
|
|
It depends on what you are modelling. Most of the time, if you're thinking about a concrete problem domain, it will be clear to you whether there is an "is a" or a "has a" relation between the things that you are modelling.
For example, suppose that you want to model a car. Clearly, a car has an engine, wheels, etc. And a car is a transportation device, etc.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
 |
|
|
subject: How to decide whether use IS A or HAS A Relation
|
|
|