Java Reference
In-Depth Information
5 Understanding Event Diagrams
Refer to the event diagram in Figure 1-27 to answer the following questions:
Track sensor detects
approaching train
Approaching train
detected
Traffic signal
turns red
Time and date
register with
recorder
Sensor detects gates
begin to lower
Gates begin
to lower
Bell rings
Sensor detects
gates down
Gates complete
lowering
Train
proceeds
FIGURE 1-27
1. List each message and its corresponding operation.
2. Which of these operations triggers a subsequent message? List any such
operation and its subsequent message.
3. Which of these operations changes the value of an attribute of an object?
List the operation, the attribute, and the attribute's value before and after the
operation.
6 Creating a Generalization Hierarchy
Pick any class of objects that interests you (for example, books, clothes, musical
instruments, physical fitness equipment). Create a generalization hierarchy
showing at least four levels of subclasses and superclasses. For each subclass,
identify several attributes inherited from the superclass.
7 Creating Class Diagrams
Draw a class diagram for each object in Figure 1-27. Include at least two attri-
butes and one method in each diagram.
8 Creating an Event Diagram
Using Figure 1-27 as an example, draw an event diagram to raise the gates when
the track sensor has detected the train is clear of the intersection. The trigger is
the lack of weight on the tracks. The events that happen include the sensor
detecting that loss of weight and the gates rising. Possible operations include
traffic signal changing, time and date recording, and gate movement.
Search WWH ::




Custom Search