... | @@ -17,9 +17,7 @@ Aggregation implies a relationship where the child can exist independently of th |
... | @@ -17,9 +17,7 @@ Aggregation implies a relationship where the child can exist independently of th |
|

|
|

|
|
|
|
|
|
## Composition
|
|
## Composition
|
|
Composition implies a relationship where the child cannot exist independent of the parent. Example: House (parent) and Room (child). Rooms don't exist separate to a House.
|
|
Composition implies a relationship where the child cannot exist independent of the parent. Example: Person (parent) and Head, Heart, and Leg (child). The children don't exist separate to a House.
|
|
|
|
|
|
### Example
|
|
### Example
|
|

|
|
 |
|
|
|
\ No newline at end of file |
|
The example contains a class person (parent) with the (child) classes head, leg, and heart. |
|
|
|
\ No newline at end of file |
|
|