Software Development and Project Management
In UML, which diagram is suitable for showing how the state of an object changes in response to events (a button press, a timer expiring, a temperature being reached and so on), as in the control software of a rice cooker?
- AClass diagram
- BUse case diagram
- CState machine diagram
Show answer and explanation
Answer: C. State machine diagram
A state machine diagram (state transition diagram) shows the possible states, which event causes a move to which state (a transition), and the actions taken at that time. It is often used to design software whose behavior depends on its current state even for the same input, as in the control of embedded devices. A class diagram shows the static structure of classes, their attributes and operations, and the relationships between classes. A use case diagram shows the functions of the system as seen by its users (actors).
- A. This diagram shows the static structure of classes, their attributes and operations, and their relationships; it does not show changes of state.
- B. This diagram shows the relationships between users (actors) and the functions of the system (use cases).
- C. Correct. It shows states and the transitions between them caused by events.
Continue: 9 more Software Development and Project Management questions