OOPortal OOPortal


Model Refinement   «Prev  Next»

Model Refinement - Quiz

Each question is worth one point. Select the best answer for each question.
 

1. What two types of behavior should be included when defining the operations for a class of objects?
Please select the best answer.
  A. External behaviors that are visible to other objects and internal behaviors that are hidden within the object and accessible only by the object itself
  B. Analysis-level behaviors that describe the way the object behaves in the problem domain and design-level behaviors that describe how the software works
  C. Behaviors that the object knows how to perform and things that other objects do to the object
  D. Interface that describes how the object talks to other objects and implementation behaviors that support the interfaces

2. What two class elements are required in your model to manage the state of an object?
Please select the best answer.
  A. One or more attributes that describe the condition of the object and corresponding operations to maintain the attribute values
  B. An attribute that describes the state of the object and the domain of valid values that can be assigned to the status attribute
  C. One operation for each way that the object's state can be changed and a corresponding attribute for each type of change
  D. One or more attributes that describe the object's responsibility and an operation that manages the modifications to the responsibilities

3. How can you be sure that an interface is required?
Please select the best answer.
  A. Ask the users. They are the experts on how the system should perform.
  B. Model the use case scenarios as interaction diagrams and assign responsibility for each interaction.
  C. Prototype the application and test out the various scenarios, removing any unneeded interfaces until the application has only interfaces it absolutely requires.
  D. Evaluate the object cohesion to ensure that every interface supports the purpose of the object.

4. How can you recognize poor cohesion in an object?
Please select the best answer.
  A. The class definition is very lengthy.
  B. Individual operations manipulate a lot of different attributes.
  C. The attributes and operations fall into distinct groups according to the function they support.
  D. There is a high degree of dependency between the object in question and other objects in the model.

5. How do you change the model to improve cohesion and coupling when an object appears to have too much responsibility?
Please select the best answer.
  A. Reassign responsibilities to an existing class or split the class into two or more classes with a narrower purpose.
  B. Find a design pattern that has been tested for that kind of situation.
  C. Encapsulate the object to hide the complexity from other objects.
  D. Define a separate interface for each responsibility. The new interface will delegate the responsibilities to the original interfaces.

Correct answers:

Your Score: 0