![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Association, Composition and Aggregation in C#
Association in C#
The association defines the relationship between an object in C#. An a one-to-one, one-to-many, many-to-one and many-to-many relationship can be defined between objects.
For example, An Employee can be associated with multiple projects, whereas a project can have more than one employee.
Composition in C#
Under Composition, if the parent object is deleted, then the child object also loses its status.
The composition is a special type of Aggregation and gives a part-of relationship.
For example, A Car has an engine. If the car is destroyed, the engine is destroyed as well.
Aggregation in C#
Aggregation is a direct relation between objects in C#. It is the relationship between objects.
For example, Employee and Department.
An Employee is associated with a single Department, whereas a Department can have more than one employee