System Design  «Prev  Next»
 

Applying Statechart Diagram to Object Design - Quiz

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

1. What features of a statechart diagram map to operations or operation implementations in the class diagram?
Please select the best answer.
  A. Activities describe functions that are built into the object. These functions are behaviors that are specific to the state in which they are defined.
  B. Events, actions, and activities map to operations or operation implementation logic.
  C. Actions specify the response to an event which typically maps to the implementation of the operation interface defined by the event signature.
  D. Events map to the public operations that define the interface to the object.

2. What causes a change in an object's state?
Please select the best answer.
  A. Activities trigger events in the course of performing the internal object behaviors. Therefore, activities cause a change in state.
  B. Events trigger activities that alter the values of the state attributes, therefore redefining the state of the object.
  C. Actions trigger activities that alter the values of the state attributes, therefore redefining the state of the object.
  D. An event triggers a state transition. An event action performs the actual change to state attributes.

3. How is the state of an object represented during the execution of the application? Please select the best answer.
  A. Object state corresponds to a unique event. Whenever the object receives a specific event, the object is set to the corresponding state.
  B. Object state is represented by the values of one of an object's attributes.
  C. Object state is represented by the values of one or more of an object's attributes.
  D. Object state corresponds to the state of a given activity. An object changes state to reflect the status of the activity from initiation to completion.

4. What does delegation mean in the state design pattern?
Please select the best answer.
  A. The responsibility for implementing a behavior is passed to an object that represents the current state of the object.
  B. The responsibility for implementing a behavior is passed to an internal private operation within the object that represents the selected state.
  C. The responsibility for validating a behavior is given to a special function within the object.
  D. The responsibility for changing the object's state is given to another object that specializes in that particular kind of change.

5. How would you identify possible state changes in an object using a sequence diagram?
Please select the best answer.
  A. Look for outgoing events from the object's vertical timeline. These outgoing events represent a change in state.
  B. Look for event returns. The response to an event requires a change in state.
  C. Look for events coming into the object's timeline. Incoming events require a response that can cause a change in the object.
  D. Look for specific event names that imply change to the object. The send and return of each of these events corresponds to a unique state of the object, for example, send and wait, and evaluate return value.

Correct answers:

Your Score: 0