This process can be represented in a sequence diagram, as shown in the figure below. A collaboration diagram is another type of interaction diagram. Like a sequence diagram, it shows how a group of objects in a use case work with one another. Each message is numbered to document the order in which it occurs. An object's state is defined as its attributes at a particular moment.
Objects move through various states as they are influenced by outside stimuli.
The statechart diagram maps these states, as well as the triggering events that cause the object to be in a particular state. For example, in our rental system, the object is a car. As a car moves through the rental system, its many states produce a complex but illuminating diagram. For example, it is first added to the fleet. It remains in the state InStock until it is rented.