October 2018
Intermediate to advanced
370 pages
9h 15m
English
When an object contains another object in its body, the relationship between them is called aggregation. This is a loosely-coupled relationship between two objects, in which one object is not completely dependent on the other. Take a look at the following examples:
This relationship is called a has-a relationship because one object has another object. We cannot say that the plant is a garden, but we can say that the garden has a plant. An object can have a relationship with more than one object:
In this relationship, both objects are loosely coupled. This means that if one object is removed from the ...
Read now
Unlock full access