State Diagrams

A state diagram describes the life history of objects of a given class.

A state diagram is used to show the following:

  • The state space of a given class

  • The events that cause a transition from one state to another

  • The actions that result from a state change

A state diagram is a directed graph of states connected by transitions.

State Notation

A state is a condition in which an object can reside during its lifetime while it satisfies some condition, performs an activity, or waits for an event. A state icon is a rounded rectangle with a name and a compartment.

For example, Figure D.7 shows the state diagram of a stateful session bean instance. It consists of three states: Instance does not exist, Ready, and Passive.

Figure D.7. State diagram example.


Transition Notation

A transition is a relationship between two states. It indicates that an object in the first state will perform certain actions, and will then enter the second state when a given event occurs. The icon for a state transition is a line with an arrowhead pointing toward the next state. For example, Figure D.7 shows that the object in the Ready state enters the Passive state when the ejbPassivate() event occurs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.88.62