What are States?
A UML State is a mode of operation for an instance of a class
- Some classes have state machines, others do not
- Each instance of a class with a state machine is “in” a given state
Example:
- Class WristWatch has states: Date, Time, StopWatch, SetDate, SetTime
- Each instance of WristWatch is in one of those states at any given moment
States influence the way the object acts
- E.g., the state of a WristWatch determines what is displayed