Javatpoint Logo

What is the difference between aggregation and association?

By: nallam*** On: Sun Feb 03 22:40:00 IST 2013     Question Reputation0 Answer Reputation0 Quiz Belt Series Points0  0Blank Profile
What is the difference between aggregation and association? Up0Down

 
Association is a relationship between two classes where one class use another. But aggregation describes a special type of an association. Aggregation is the relationship between two classes. When object of one class has object of another, if second is a part of first then we called that there is an aggregation between two classes. Unlike association, aggregation always insists a direction.Image Created0Down

By: [email protected] On: Mon Feb 04 11:31:29 IST 2013 Question Reputation0 Answer Reputation0 Belt Series Points0 0User Image
Are You Satisfied :1Yes0No
 
An association describes a relationship between instances of one or more classes.

Aggregation is a form of association in which there is a "whole-part" relationship. You may say that if a class Airplane has a class Engine then this forms a "whole-part" relationship.
Image Created0Down

By: [email protected] On: Mon Feb 04 11:41:12 IST 2013 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :0Yes0No