• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

has a relationship

 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Saral Saxena
Ranch Hand
Posts: 203
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15480
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi kapa,
Your post was moved to a new topic.
A new question deserves a new forum topic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic