04-29-2011, 08:44 AM
Aggregation is a relationship between the container and contained object. Aggregation is a weaker relationship, because aggregate object is not a part of the container, and aggregate object can exist independently. Aggregation is implemented in c++ by using a pointer or reference to an object that is created inside a class.
Real world example:
A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy.
Example:
class Student{
--------------
};
class Teacher: public Student {
-------------------
Student * name; //Here is aggregation relationship b/w Student and Teacher class
-------------------
-------------------
Real world example:
A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy.
Example:
class Student{
--------------
};
class Teacher: public Student {
-------------------
Student * name; //Here is aggregation relationship b/w Student and Teacher class
-------------------
-------------------
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
