Object Design Tools - Quiz Explanation
The correct answers are indicated below, along with text that explains the correct answers.
1.
How do the interaction diagrams aid in the process of defining a class?
Please select the best answer.
A.
The interaction diagrams are drawn from the client's perspective so they don't use technical jargon.
B.
The interaction diagrams identify interfaces required for the communication between objects.
C.
The interaction diagrams identify the internal behavior of the participating objects.
D.
The interaction diagrams are drawn using classes so it is easy to see how each class participates in the dialog.
The correct answer is B.
Interaction diagrams aid in the process of defining a class because they identify the interfaces that are required for the communication between objects. Each interface is added to the class that corresponds to/defines the participating object. A is incorrect because interaction diagrams can also be used to model software types of objects with which clients are totally unfamiliar. C is incorrect because interaction diagrams do not model any internal behavior; they only show the communication between objects. D is incorrect because interaction diagrams use objects, not classes.
2.
How does an activity diagram help you define a class?
Please select the best answer.
A.
Activity diagrams model logic, so they are very good for designing the implementation of an operation or interface.
B.
Activity diagrams model the logical relationships between objects, so they are good for identifying associations.
C.
Activity diagrams document the communication between objects.
D.
Activity diagrams document the attribute definitions and edit rules for each attribute.
The correct answer is A.
Activity diagrams model logic, so they are very good for designing the implementation of an operation or interface, for example, the implementation of the interface. B is incorrect because activity diagrams do not model relationships, they model activities or processes. C is incorrect because interaction diagrams, not activity diagrams, model communication between objects. D is incorrect because activity diagrams do not model attributes or their edit rules.
3.
What parts of a statechart diagram map to parts of a class definition?
Please select the best answer.
A.
The states translate into events passed between objects.
B.
The events, actions, and activities translate to operations. The arguments and returns translate to attributes.
C.
The events become interfaces on the class of the receiving object.
D.
The actions and activities translate to interfaces used in the communication between objects.
The correct answer is B.
The events, actions, and activities translate to operations and/or operation implementations. The arguments and returns translate to attributes. A is incorrect because states do not translate into events. States are represented by attribute values. C is incorrect because there is only one object in a statechart diagram so all of the events refer to the same object. In fact, these same events were already translated to interfaces in the sequence or collaboration diagrams used to build the statechart diagram. D is incorrect because the statechart does not model communication between objects. The statechart models stimuli and responses for a single object.
4.
What part/s of an interaction diagram may be modeled with an activity diagram?
Please select the best answer.
A.
Conditional interactions between objects that cannot be represented in an interaction diagram
B.
The reflexive/recursive events only, for example, events in which the object refers to one of its own internal operations
C.
The design of individual events/interfaces, for example, the logic used to implement the response to the event
D.
The transitions in the state of an object during the time-span of the interaction
The correct answer is C.
The activity diagram may be used to model the design of individual events/interfaces. A is incorrect because conditional interactions may also be represented in a sequence diagram. Conditional logic is not as easily or clearly represented in interaction diagrams, but it is supported by the UML standard. B is incorrect because any event/interface may be more fully described with an activity diagram, not just reflexive/recursive events. D is incorrect because state transitions cannot be modeled with an activity diagram. A statechart diagram should be used to model states and state transitions.
5.
Where do you find attributes that should be assigned to your class definitions?
Please select the best answer.
A.
Derive the attributes from the definition of the class in the data dictionary by identifying the properties that best describe the objects included in the class.
B.
Identify the attributes from the class descriptions referenced in the use cases.
C.
Each argument/parameter and return value in every operation becomes an attribute on some object in the model.
D.
Find the nouns in the data dictionary that do not represent classes but are still required as part of the problem domain because they are referenced by the users in describing the system functionality.
The correct answer is C.
Each argument/parameter and each return value represents a piece of information. In an object-oriented model, every piece of information is represented as an attribute that is owned and managed by some object. This method of finding attributes ensures that the attributes are actually required to support the behaviors of the system. A is incorrect because this method does not provide the ability to test the validity of a particular attribute. It depends solely on the discernment of the person writing the definition, rather than on the actual functionality of the system, to determine the appropriateness of each piece of information. B is incorrect because class descriptions are not written in the use cases. Classes may be referenced but not their definitions. D is incorrect for the same reason as A. The terminology documented in the data dictionary may come from a wide range of sources, including discussions of the problem statement, context, scope, etc. Before an attribute is added to a class definition there should be an explicit justification for its use. Remember that every attribute requires time and money for analysis, design, coding, testing, and maintenance. Don't spend time and money that cannot be justified.