Question

In: Computer Science

In what respects does a UML state diagram differ from a state transition diagram?

In what respects does a UML state diagram differ from a state transition diagram?

Solutions

Expert Solution

State Diagram

A state diagram is used to represent the condition of the system or part of the system at finite instances of time. It’s a behavioral diagram and it represents the behavior using finite state transitions. State diagrams are also referred to as State machines and State-chart Diagrams. These terms are often used interchangeably. So simply, a state diagram is used to model the dynamic behavior of a class in response to time and changing external stimuli. We can say that each and every class has a state but we don’t model every class using State diagrams. We prefer to model the states with three or more states.

Uses of statechart diagram –

  • We use it to state the events responsible for change in state (we do not show what processes cause those events).
  • We use it to model the dynamic behavior of the system .
  • To understand the reaction of objects/classes to internal or external stimuli.

Basic components of a statechart diagram –

  1. Initial state – We use a black filled circle represent the initial state of a System or a class.

    Figure – initial state notation

  2. Transition – We use a solid arrow to represent the transition or change of control from one state to another. The arrow is labelled with the event which causes the change in state.

    Figure – transition

  3. State – We use a rounded rectangle to represent a state. A state represents the conditions or circumstances of an object of a class at an instant of time.

    Figure – state notation

  4. Fork – We use a rounded solid rectangular bar to represent a Fork notation with incomig arrow from the parent state and outgoing arrows towards the newly created states. We use the fork notation to represent a state splitting into two or more concurrent states.

    Figure – a diagram using the fork notation

  5. Join – We use a rounded solid rectangular bar to represent a Join notation with incoming arrows from the joining states and outgoing arrow towards the common goal state. We use the join notation when two or more states concurrently converge into one on the occurrence of an event or events.

    Figure – a diagram using join notation

  6. Self transition – We use a solid arrow pointing back to the state itself to represent a self transition. There might be scenarios when the state of the object does not change upon the occurrence of an event. We use self transitions to represent such cases.

    Figure – self transition notation

  7. Composite state – We use a rounded rectangle to represent a composite state also.We represent a state with internal activities using a composite state.

    Figure – a state with internal activities

  8. Final state – We use a filled circle within a circle notation to represent the final state in a state machine diagram.

    Figure – final state notation

State-Transition Diagrams
State-transition diagrams describe all of the states that an object can have, the events under which an object changes state (transitions), the conditions that must be fulfilled before the transition will occur (guards), and the activities undertaken during the life of an object (actions). State-transition diagrams are very useful for describing the behavior of individual objects over the full set of use cases that affect those objects. State-transition diagrams are not useful for describing the collaboration between objects that cause the transitions.

The UML notation for state-transition diagrams is shown below:

Notation

For those not familiar with the notation used for state-transition diagrams, some explanation is in order.

State. A condition during the life of an object in which it satisfies some condition, performs some action, or waits for some event.

Event. An occurrence that may trigger a state transition. Event types include an explicit signal from outside the system, an invocation from inside the system, the passage of a designated period of time, or a designated condition becoming true.

Guard. A boolean expression which, if true, enables an event to cause a transition.

Transition. The change of state within an object.

Action. One or more actions taken by an object in response to a state change.


Related Solutions

In what respects does the offense of solicitation differ from the offense of conspiracy?
In what respects does the offense of solicitation differ from the offense of conspiracy?
In a state machine diagram with composite states, what is the meaning of a transition that...
In a state machine diagram with composite states, what is the meaning of a transition that goes from the boundary of a state? What is the meaning of a transition that goes to the boundary of a state?
In a state machine diagram with composite states, what is the meaning of a transition that...
In a state machine diagram with composite states, what is the meaning of a transition that goes from the boundary of a state? What is the meaning of a transition that goes to the boundary of a state?
what exactly is a phase diagram and how does it differ from heating curve?? what are...
what exactly is a phase diagram and how does it differ from heating curve?? what are the differences between supercritical point, triple point and critical point?
state the scope of macroeconomics? how does it differ from microeconomics.
state the scope of macroeconomics? how does it differ from microeconomics.
create the UML Diagram to model a Movie/TV viewing site. Draw a complete UML class diagram...
create the UML Diagram to model a Movie/TV viewing site. Draw a complete UML class diagram which shows: Classes (Only the ones listed in bold below) Attributes in classes (remember to indicate privacy level, and type) No need to write methods Relationships between classes (has is, is a, ...) Use a program like Lucid Cart and then upload your diagram. Each movie has: name, description, length, list of actors, list of prequals and sequals Each TV Show has: name, description,...
Draw a UML diagram for the classes. Code for UML: // Date.java public class Date {...
Draw a UML diagram for the classes. Code for UML: // Date.java public class Date {       public int month;    public int day;    public int year;    public Date(int month, int day, int year) {    this.month = month;    this.day = day;    this.year = year;    }       public Date() {    this.month = 0;    this.day = 0;    this.year = 0;    } } //end of Date.java // Name.java public class Name...
What role does the transition state play in the decrease in activation energy that results with...
What role does the transition state play in the decrease in activation energy that results with the addition of an enzyme?
For the hydrogen atom, the transition from the 2p state to the 1s state is accompanied...
For the hydrogen atom, the transition from the 2p state to the 1s state is accompanied by the emission of a photon with an energy of 16.2×10-19 J. For a C atom, the same transition (2p to 1s) is accompanied by the emission of x-rays of wavelength 44.7 Å. What is the energy difference between these states in carbon? J The energy difference between these states in carbon is _________larger than smaller than about the same as the corresponding energy...
In Problem is there a unique way of filling in the missing probabilities in the transition diagram? If so, complete the transition diagram and
In Problem is there a unique way of filling in the missing probabilities in the transition diagram? If so, complete the transition diagram and write the corresponding transition matrix. If not, explain why.  
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT