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,...
How does family firm differ from state owned enterprises?
How does family firm differ from state owned enterprises?
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?
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...
How does the structure of accounting and reporting for a state or local government differ from...
How does the structure of accounting and reporting for a state or local government differ from that of a business? List the types of funds that organize the financial affairs of a government. Look up your state, city, county, or school financial statement and identify two to three funds that fall under each of the categories you listed before. Include a link to the document that you used to answer this question along with stating whether you used a state,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT