Object Model - Quiz Explanation

The answers you selected are indicated below, along with text that explains the correct answers.
 
1. Delegation is an alternative for using
Please select the best answer.
  A. Inheritance
  B. Aggregation
  C. A qualified association
  D. An association class
  The correct answer is A. Delegation is an alternative for using inheritance. B and C are incorrect because aggregation and qualified associations have their own notation and are part of the UML. Delegation is a design pattern that can be modeled using UML notation. D is incorrect because delegation cannot replace associations.

2. Association classes
Please select the best answer.
  A. May not be associated with other classes
  B. May be used like other classes
  C. May be associated with no more than two classes
  D. May be used only on many-to-many associations
  The correct answer is B. Association classes may be used like other classes. A, C, and D are incorrect because an association class has all the characteristics of any other class and can be used in any number of associations and with any multiplicity.

3. Operations specify the
Please select the best answer.
  A. Implementation of a class behavior
  B. Interface and implementation
  C. Interface for a class behavior
  D. Constraints on an implementation
  The correct answer is C. Operations specify the interface for a class behavior. A and B are incorrect because methods specify the implementation, not operations. D is inadequate because constraints are only one part of what operations do.

4. Reflexive associations are used
Please select the best answer.
  A. When roles are required
  B. When more than two classes participate in an association
  C. To qualify associations to reduce multiplicity
  D. When objects in the association are from the same class
  The correct answer is D. Reflexive associations are used when objects in the association are from the same class. A is incorrect because reflexive associations are not dependent on the use of roles. Roles are a helpful tool that can be used with any association. B is incorrect because reflexive associations refer specifically and uniquely to associations that have both ends connected to the same class. C is incorrect because it refers to qualified associations.

5. Discriminators are used with
Please select the best answer.
  A. Aggregations
  B. Generalization
  C. Qualified associations
  D. Reflexive associations
  The correct answer is B. Discriminators are used with generalization exclusively. A, C, and D are incorrect because each of these other concepts has its own notation, none of which includes discriminators.

6. The asterisk in multiplicity means
Please select the best answer.
  A. Many
  B. Zero to many
  C. More than 1
  D. Not required
  The correct answer is B. The asterisk by itself in multiplicity means zero to many. A and C are incorrect because the asterisk means many only when it is preceded by a minimum, as in 1..*. D is incorrect because the asterisk is needed for any multiplicity with an upper limit of more than one.

7. Qualified associations use
Please select the best answer.
  A. A class attribute as an identifier
  B. An association as an identifier
  C. A unique value to reference an object
  D. A unique association to reference an object
  The correct answer is A. Qualified associations use a class attribute as an identifier. B and D are incorrect because an association is not an identifier. C is incorrect because a qualifier does not have to be unique.

8. Aggregation is different from composition because
Please select the best answer.
  A. The parts of an aggregation go away when an aggregate goes away
  B. Composition lasts longer than aggregation
  C. Composition is modeled using a context diagram
  D. The parts of a composition go away when a composite goes away
  The correct answer is D. Aggregation is different from composition because the parts of a composition go away when a composite goes away. A is incorrect because the parts of an aggregation can live on after the aggregate is dissembled. B is incorrect because aggregates may exist longer than composites. There is nothing in the nature of either that determines how long they last. C is incorrect because composition can be modeled using the solid diamond notation as well as the context diagram notation.


UML Distilled