This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Java in General and the fly likes What is the difference between aggregation and composition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is the difference between aggregation and composition" Watch "What is the difference between aggregation and composition" New topic
Author

What is the difference between aggregation and composition

Maki Jav
Ranch Hand

Joined: May 09, 2002
Posts: 438
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


Help gets you when you need it!
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
As so often is the case, the JavaRanch FAQ has something to say about this: AssociationVsAggregationVsComposition
 
 
subject: What is the difference between aggregation and composition
 
jQuery in Action, 3rd edition