04-29-2011, 08:43 AM
What is Aggregation in OOP?
|
What is Aggregation in OOP?
|
|
04-29-2011, 08:43 AM
What is Aggregation in OOP?
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 ------------------- ------------------- 0300-9520262 Get solution in 24 hour |cpmputer & internet mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| In aggregation we use a pointer e.g. like chair object in a room class | saneha | 1 | 2,569 |
05-02-2011, 04:48 PM Last Post: Vuhelper |
|
| elaborate real difference between association and aggregation in real time percepecti | saneha | 1 | 4,320 |
04-29-2011, 08:43 AM Last Post: Vuhelper |
|