aspose file tools*
The moose likes Beginning Java and the fly likes How to decide whether use IS A or HAS A Relation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to decide whether use IS A or HAS A Relation" Watch "How to decide whether use IS A or HAS A Relation" New topic
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14105
    
  16

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to decide whether use IS A or HAS A Relation