aspose file tools*
The moose likes Java in General and the fly likes has a relationship Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "has a relationship" Watch "has a relationship" New topic
Author

has a relationship

Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Hi All,

Can anyone please explain the exact difference between IS-A and HAS-A relationship with an example.

what I grasp is that..




the above code shows IS A relationship, this can be implemented as Inheritance. what term stands for it in uml...? like composition we have for has a relationship..?





this shows HAS A relationship.
HAS A also know as composition.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

Saral Saxena wrote:
...
what term stands for it in uml...? like composition we have for has a relationship..?


I am not aware of any special term for IS-A, I think its referred to an Inheritance only.

In UML there are 2 types of notation for HAS-A- Aggregation and Composition. In Composition the composed object cannot exist on its own i.e its always part of the composing object. In otherwords composition is stronger form of Aggregation.


Mohamed Sanaulla | My Blog
Saral Saxena
Ranch Hand

Joined: Apr 22, 2011
Posts: 202

Mohamed Sanaulla wrote:
Saral Saxena wrote:
...
what term stands for it in uml...? like composition we have for has a relationship..?


I am not aware of any special term for IS-A, I think its referred to an Inheritance only.

In UML there are 2 types of notation for HAS-A- Aggregation and Composition. In Composition the composed object cannot exist on its own i.e its always part of the composing object. In otherwords composition is stronger form of Aggregation.


Hi ,

Yeah you are right ,, IS A stands for inheritance , I am looking for the term that what its represents in UML notation..?? can you please also explain Aggregation , composition with a real life example that will make understandings more clear..!1
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

Saral Saxena wrote:
Mohamed Sanaulla wrote:
Saral Saxena wrote:
...
what term stands for it in uml...? like composition we have for has a relationship..?


I am not aware of any special term for IS-A, I think its referred to an Inheritance only.

In UML there are 2 types of notation for HAS-A- Aggregation and Composition. In Composition the composed object cannot exist on its own i.e its always part of the composing object. In otherwords composition is stronger form of Aggregation.


Hi ,

Yeah you are right ,, IS A stands for inheritance , I am looking for the term that what its represents in UML notation..?? can you please also explain Aggregation , composition with a real life example that will make understandings more clear..!1

I would suggest to start with searching for information on the web, as UML notations are readily available at lot of places- inheritance uml notation
And for the Aggregation, Composition examples here is one of the many links I found.
The difference in the UML notation for Aggregation and Composition is that for composition the Diamond used at the line is filled. The link given before shows examples for all the notations used in the UML class diagram.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14108
    
  16

Ravi kapa,
Your post was moved to a new topic.
A new question deserves a new forum topic


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: has a relationship