UML Aggregation and Composition - Quiz Explanation

The answers you selected are indicated below, along with text that explains the correct answers.
 
1. A PC is composed of a motherboard, disk drives, and I/O devices. The PC is sold as a single unit without optional configurations. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is B, composition. The parts and the PC are inseparable.

2. A travel package consists of airfare, hotel, and rental car reservations. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is B, composition.
The airfare, hotel, and travel reservations are not available apart from the package.

3. Employees use our company cars. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is C, association.
There is no assembly implied in the relationship.

4. The motors in the generators are replaced every 6 months. The motors are rebuilt and put back into service. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is A, aggregation.
The motors are installed in the generators but can be removed, replaced, and installed in other generators.

5. PCs are assigned to employees and follow them to each new job assignment. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is C, association.
People simply use the PCs, they are not assembled together.

6. A class is composed of 5 to 20 students and one or more instructors. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is A, aggregation.
Even though the students and instructors are assembled together for the purpose of holding a class, the life spans of the parts, students and instructors, do not depend on the life span of the class.

7. Our printers have replaceable ink cartridges, but we do not keep the cartridge when we dispose of the printer. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is B, composition.
The life span of the cartridge depends on the life span of the printer, even though the printer may use many cartridges over time.

8. Each kit comes with four spare widgets. Incomplete kits are destroyed. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is B, composition.
The parts only have significance as part of the widget. There is a life span dependency between the parts and the aggregate.

9. These phones are so cheap that when parts such as the speaker or microphone fail, we just replace the whole phone. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is B, composition.
There is a life span dependency between the parts and the aggregate.

10. Our company is actually made up of a number of smaller companies. This example should be modeled as
Please select the best answer.
  A. Aggregation
  B. Composition
  C. Association
  The correct answer is A, aggregation.
The parent company can be dissolved and the owned companies can continue to exist and do business. There is no life span dependency.


UML Distilled