Difference between Aggregation and Association
Aggregation: Collecting or gathering of things together is called aggregation. It signifies a “has a” relationship between two related objects. We can say that there is an aggregation between two classes if object of one class has object of another and if second is a part of the first.
Association: Association reflects a binary relationship between two objects which is able to describe an activity. Relationship between object can be defined by association. For example, a bank employee can be associated with multiple clients. An organization of people with a common purpose and formal structure is represented by the term association.
Aggregation | Association |
---|---|
1. A special type of an association which specifies a whole and part relationship is described by the term aggregation. | 1. Relationship between two classes where one class use another is represented by the term association. |
2. Nature is flexible. | 2. Nature is inflexible. |
3. Diamond shape structure is used in aggregation and it is placed next to assemble class. | 3. Line segment is used between the class in association. |
4. For maintaining aggregation, linkage between object is not mandatory. | 4. For maintaining association, linkage between objects is needed. |
5. Aggregation reflects “has a” relationship between two classes where one class contains object of another class. | 5. Association reflects “has a” relationship between two classes where one class use another. |
Recommended Posts:
- Difference between Schema and Instance
- Difference between DBMS and RDBMS
- Difference between Primary Memory and Secondary Memory
- Difference between Guided Media and Unguided Media
- Difference between Flow control and Error control
- Difference between Point-to-point and Multi-point Communication
- Difference between Client Server network and Peer to peer network
Contributed By: Romana Rahman Ema