answersLogoWhite

0


Best Answer

Aggregation and composition are two sides of the same coin. Both an aggregate and a composite object encapsulate one or more sub-objects. But while a composite object owns its sub-objects, an aggregate object does not. That is, when a composite object is destroyed, its sub-objects are also destroyed. But with an aggregate object, the sub-objects are not destroyed.

Aggregate objects typically use references or pointers to refer to their sub-objects, whereas composite objects typically use member variables or pointers to refer to their objects. In essence, a composite object instantiates its own sub-objects, whereas an aggregate object's sub-objects must be passed to it, typically via the constructor.

In complex models you will often find a combination of composition, aggregation and inheritance, even within the same object.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is aggregation in C plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Can you declare a method within a method in c or c plus plus?

C: there are no methods in C. C++: no.


What is the different of c and c plus plus?

c is procedure oriented and c++ is object oriented & much newer.


How A plus B plus C plus D plus 80 plus 90 equal to 100 what is the value of A B C and D?

If a + b + c + d + 80 + 90 = 100, then a + b + c + d = -70.


In computer language C plus plus is related to?

C++ is related to C, the language from which it is derived.


What is meant by println in c plus plus?

println is not a C++ keyword.

Related questions

What has the author C A Macken written?

C. A. Macken has written: 'Branching processes applied to cell surface aggregation phenomena' -- subject(s): Branching processes, Cell aggregation, Cell membranes, Mathematics


What is b plus b plus b plus c plus c plus c plus c?

b+b+b+c+c+c+c =3b+4c


What is c plus c plus 2c plus c plus c equal?

c + c + 2c + c + c = 6c


B plus b plus b plus c plus c plus c plus c equals?

b + b + b + c + c + c + c = 3b + 4c


Symplify c plus c plus c plus c?

4c


What is c plus c plus c plus c plus c?

c + c + c + c + c = 5 * c.


Primary and secondary key in c and c plus plus?

There are no "primary and secondary keys" in c and c plus plus.


What is c plus C plus C answer in algebra?

3c


What is the different between turbo c plus plus and unix c plus plus?

There is no such thing as 'unix C++'.


What to Do if Macros does not exist in C and C plus plus?

They do exist in C and C++.


How do you put aggregation in a sentence?

The aggregation between a man and a woman is considered a marriage. aggregation means a group or mass of distinct or varied things, persons


Can you give me a sentence using the word aggregation?

The aggregation between a man and a woman is considered a marriage. The aggregation between a man and a woman is considered a marriage.