Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Aggregation

 
Anu
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone pls do me a favor of explaining wht does Aggregation means in Java. I would also like to know abt aggregate object.

Thanx in Advance.
Anukampa
 
Bharatesh H Kakamari
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inheritance is a 'is a' Relationship.

This is 'is a' relationship. Sub class is-a Super class.
If a class extends another the relationship is termed as 'is-a'.
Now consider the following:

This is a 'has-a' relationslip. If a class has an object of another class, it is a 'has-a' relationship. Or Aggregation.
HTH
 
Anu
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx a ton Bharatesh. I got yr point and concept too.

Anukampa
 
Jaya Murugan
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anukampa,
thanks for the nice explantion. what about implementing the interface.???
thanks
regards
Jaya Murugan
 
rajni_singh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think implementing an interface will be again
"is - a " relationship.
Correct me if I am wrong.
 
Bharatesh H Kakamari
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class-interface relationship is termed as Realization relationship (This is from Rational Rose tool)
Definition : Realize Relationship
Definition
A realization relationship between classes and interfaces and between components and interfaces shows that the class realizes the operations offered by the interface.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic