Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What is the difference between aggregation and composition

 
Maki Jav
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between aggregation and composition?

I know that there are concepts which are related to it like weak HashMap and HashMap and Garbage Collection.

The part is destroyed if the whole is destroyed in aggregation.

Well the concept is not clear to me very much.

Thanks in advance for replies,

Maki Jav
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As so often is the case, the JavaRanch FAQ has something to say about this: AssociationVsAggregationVsComposition
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic