or composition is one of the two most important ways to reuse code in
object oriented programming languages (the other is inheritance).
|Aggregation is an
operation which models a so called “has a” relationship, like in a car
has an engine, which is exactly the example we shown two slides ago: this
shows to you that the data members of a class do not have to be necessarily
C++ basic data types (char, int, float, and so on…) but can be also instances
of the data types that the user has defined by mean of the class keyword.
|Actually, one of the
major effort in the design of the C++ language was to let the user defined
data types be as indistinguishable as possible from the “native” basic data