Problem Analysis - Quiz Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. What is the purpose of problem analysis?
Please select the best answer.
  A. To understand the purpose and interfaces of the key problem domain classes
  B. To understand and model the relationships between the problem domain classes
  C. To understand the software resources needed to support the problem domain
  D. To understand the resources used by the problem domain
  The correct answer is D.
The purpose of problem analysis is to understand the resources used by the problem domain. A is incorrect because it describes the scope, not the purpose of problem analysis. B is incorrect because it dos not describe how or why we arrive at the choice of what problem domain classes are. C is incorrect because during problem analysis there is no discussion of software issues at all.

2. What is the scope of problem analysis?
Please select the best answer.
  A. To define the purpose and interface of the problem domain resources
  B. To define the purpose, attributes, and behaviors of the problem domain resources
  C. To define the implementation of the problem domain resources
  D. To define the relationships between the problem domain resources
  The correct answer is A.
The scope of problem analysis is to define the purpose and interface of the problem domain resources. B is incorrect because the scope includes only purpose and interfaces, not attributes that are hidden within an encapsulated object. C is incorrect because implementation is not considered until object design. D is incorrect because relationships are only one part of the problem domain modeling effort. Without purpose and interfaces, there is no reference point for deciding which relationships are pertinent.

3. How is generalization different from other associations?
Please select the best answer.
  A. Generalization defines the type of association using a triangle instead of an association name.
  B. Generalization defines the attributes and operations that a set of objects has in common.
  C. Generalization defines the organization of parts of a class definition whereas association defines how objects are related to one another.
  D. Generalization defines classes as parts of a whole with one interface rather than as distinct entities with separate interfaces.
  The correct answer is C.
Generalization defines the organization of parts of a class definition where an association defines how objects are related to one another. A is incorrect because it describes only a difference in representation, not why they are different. B is incorrect because it describes only one aspect of generalization and does not contrast it with other associations. D is incorrect because this answer fits aggregation more than generalization.

4. Why would you use aggregation if it does not generate different code than a regular association?
Please select the best answer.
  A. To simplify the representation of a collection of related objects using a diamond instead of an association name
  B. To communicate that all interactions with this assembly of objects should be performed through the aggregate object interface
  C. To show how a set of objects is assembled
  D. To communicate to the developer how to assemble a set of objects to create a new object
  The correct answer is B.
You should use aggregation to communicate that all interactions with this assembly of objects should be performed through the aggregate object interface. A is incorrect because representation is far too trivial a reason. Aggregation conveys a specific intent regarding how to use the objects. C is incorrect because it conveys only part of the intent, the assembly, and ignores the more important issue of how to work with the aggregate object once it is assembled. D is incorrect for much the same reasons as C. How to assemble the objects is only one part of the reason to use aggregation. The use of the aggregate object has a greater effect on the design and function of the system than on how the part objects are associated with one another. Simple associations can model any kind of relationship.

5. An association describes a relationship between
Please select the best answer.
  A. Objects in different classes
  B. Multiple objects
  C. An object in one class and objects in another class
  D. Objects in the same class
  The correct answer is B.
An association describes a relationship between multiple objects. A is incorrect because reflexive associations relate objects in the same class. C is incorrect because multiple objects in both classes may be associated with one another. This perspective is useful for defining the multiplicity for each end of an association, but it does not help define what an association is. D is incorrect because this includes only reflexive associations, not all the other associations between objects in different classes.

6. How is a discriminator used?
Please select the best answer.
  A. To identify the rules that govern the multiplicity on an association
  B. To identify the factors that allow two objects to be associated
  C. To identify the levels of a multilayered generalization
  D. To identify the distinguishing factor(s) between subclasses in a generalization
  The correct answer is D.
A discriminator is used to identify the distinguishing factor(s) between subclasses in a generalization. A is incorrect because this answer describes a constraint, not a discriminator. B is incorrect because a discriminator is used only in a generalization. C is incorrect because the layers each require their own discriminator. There really is no term for the layers in a generalization.

7. How do you determine multiplicity?
Please select the best answer.
  A. Ask "How many objects of one class are associated with one object of the other class?"
  B. Ask "How many objects in each class are associated with objects of the other class?"
  C. Ask "How many objects can participate in this type of relationship?"
  D. Ask "How many objects of one class are associated with one object of the other class at any given point in time?"
  The correct answer is A.
Determine multiplicity by asking: "How many objects of one class are associated with one object of the other class?""
B is incorrect because it does not focus on each end of the association separately. Multiplicity is a single value for each end of the association representing the number of objects that can be directly associated with a single object. C is incorrect because it is too vague. Multiplicity is a specific value for each end of the association. D is incorrect because it adds a time constraint that does not apply to every problem domain.

8. What elements make up the description of an association?
Please select the best answer.
  A. An association line, multiplicity, an association name, and constraints
  B. An association line, name and/or roles, and optionally constraints
  C. An association line, multiplicity, name and/or roles, and optionally constraints
  D. An association line, multiplicity on both ends, and name and/or roles
  The correct answer is C.
The elements that make up the description of an association are an association line, multiplicity on both ends, name and/or roles, and optionally constraints. A is incorrect because it leaves out the option of roles. B is incorrect because it leaves out multiplicity. D is incorrect because it excludes constraints.

9. What distinguishes aggregation from composition?
Please select the best answer.
  A. Composition defines a life span dependency between parts and the whole, whereas aggregation does not.
  B. Aggregation defines the assembly of logical components rather than physical components.
  C. Composition defines a physical assembly of objects, whereas aggregation may be used for both logical and physical assemblies.
  D. Aggregation defines the history of the parts used in an assembly over time, whereas composition does not.
  The correct answer is A.
Aggregation is distinguished from composition by the fact that composition defines a life span dependency between parts and the whole, whereas aggregation does not. B is incorrect because aggregation may be used to model physical assemblies too. Hence, this cannot be the distinguishing factor between the two concepts. C is incorrect because it does not identify the life span dependency in composition that is the real distinction between the two concepts. D is incorrect because aggregation does not have to track history. The need for history is determined by the needs of the problem domain.

10. When would you use a qualified association?
Please select the best answer.
  A. To map directly to the indexing required on the database
  B. To communicate to the developer how the database access works in legacy systems
  C. To reduce multiplicity when navigating across an association
  D. To reduce the time it takes to map the logical model to the physical implementation
  The correct answer is C.
Use a qualified association to reduce multiplicity when navigating across an association. Qualified associations work like indexes to facilitate access to specific objects of a class. A is incorrect because problem analysis is not concerned with implementation issues. The value at this point in the project is to capture the logical relationships needed to support the problem domain. B is incorrect because during problem analysis, you are modeling requirements, not historical workings of previous implementations. D is incorrect because you should not be thinking about the implementation at this point in the development life cycle.