menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Technology News

>

Understand...
source image

Medium

1w

read

140

img
dot

Image Credit: Medium

Understanding the Difference between Association, Aggregation and Composition in Java

  • Association is a basic and loose form of relationship; two objects know about each other, but are not strictly dependent.
  • Aggregation is a special case of association; objects represent a 'has-a' relationship, where one object contains a reference to another.
  • Association and aggregation allow objects to exist independently of each other.
  • In the context of a Student-University relationship, association allows for change of universities, while aggregation, in the case of departments and professors, allows for the existence of professors even if a department is removed.

Read Full Article

like

8 Likes

For uninterrupted reading, download the app