An event is an occurrence defined by an object's behavior that can move the object from one state to another. In a UML state diagram, states appear as boxes, transitions as arrows, and event labels identify the behavior causing each transition. section 4.4
A car changing state
A Car begins in the parked state. Starting the engine is an event that changes it to idling; accelerating then changes it to heading north. The object's speed and heading instance variables characterize its runtime state. section 4.4
Use events to reason about behavior and design:
- Connect each event to the behavior that produces it, usually an object's method. section 4.4
- Map the event to the state transition it causes, including decision branches, merges, forks, and joins when behavior is conditional. section 4.4
- Use published Event objects to notify multiple observers when a subject changes, allowing log, table, graph, and fan-club reports to respond independently. section 12.1.3
- Distinguish domain events from Python's threading.Event, which coordinates threads by signaling that meter setting has started. section 16.3.1
A baseball Event
EventMaker produces Event objects for each hit. BaseballReporter stores the current event and notifies attached observers with the player's name. LogReport interprets the hit, TableReport updates per-player counts, GraphReport accumulates hit categories, and FanClubReport responds to a selected player. section 12.1.3
Figure 4.15 A UML state diagram that shows the state changes of a Car object during run time. Each box represents a state, and each arrow represents a transition from one state to another. Each transition is labeled with the behavior (event) that causes the transition. Such a diagram allows us to visualize what happens to a particular object during run time and helps to ensure that we designed the class with the correct instance variables and methods.
Visualizes a Car object's states, transitions, and behavior-labeled events at run time. section 4.4

















