State Chart Diagrams

State Chart Diagrams

Table of Contents

State chart diagrams will be describing how an object will change in response to the external events. Suppose if we want to describe the state diagram which will show all possible states an object will can get in its lifetime.

UML state chart will be based up on the David Harels state chart which will show state machine consisting of states, transitions, events, actions which is very useful in conceptual design of the application and work against database of the stored objects.

State chart diagram can be made used in forwarding as well as reversing the system engineering. 

Before drawing the diagram make sure of the following things:

1. We need to analyse which is important object

2. We need to see important state

3. We need to see important events

Most important elements of the state chart diagrams shown are:

  1. States
  2. Transitions
  3. Start
  4. Stop
  • States: States will show with rounded corners which will represent the situation in the life time of an object.
  • Transitions: this will be shown as the solid arrows between the states which represent the paths between various states of an object.

They have been labelled by the event name, actions and the event triggers the transitions and the action records from it. Guard will be an additional and also the optional condition which will specify condition under which the change of the state may not occur.

  • Start: this is been shown by the solid circle with an outgoing arrow to the state.
  • Stop: this will be shown as the double lined filled circle with the arrow pointing into it from the state.

Activity diagrams: Activity diagrams will represent the dynamic view of the system by modelling the flow of control from the activity to activity which can be considered as flow charts with the states.

Diagram: State chart diagram notations

Modelling and design example:

Suppose there is a scenario students enrolling in course which will be offered by professors, registrar’s office are in charge of maintaining schedule courses in course catalog.

They will be having authority to add and delete courses and do schedule changes which will set enrolment limits on courses.

Financial aid office is a charge of processing student aid applications for which for which students will apply.

Assuming we have to design the database which maintain the data about students, professor, courses, aid etc.

One of the first steps involved in the designing database is to gather customer requirements by using use case which will enables us to do the course registration, financial aid application procedure and keeping the university wide course catalog by the registrar’s office.

Suppose one of the requirements in the university database is to allow the professor which will enter the grades for the courses which will apply for the financial aid. use case diagram will be corresponding to the use case will be drawn as shown in the diagram

Request registration

Get course list

Select course

Add course

Diagram: Sequence diagram for the university database

Schedule

Sequence of operation from one task to another is called as schedule, it is used to protect the operations of each transaction. 

Transaction is nothing but the order of Structure Query Language statements which will merge together to form a unit

Schedule is been categorized into three section which are listed below:

1. Series schedule

2. Non series schedule

3. Serialisable schedule

Series schedule: this is the type where one transaction will be completed then only next transaction will be scheduled for such operation we call it as series schedule. Let’s consider an example; suppose there are two transaction L1 and L2 which will have some operation if there are not leaving the operation it might have following situation

a. It will execute all operations of the L1 then followed by operation of L2

Non series schedule: suppose if the  interleaving is been entered in operation then it is called to be as non serial schedule, this kind of schedule will include many orders where the system will be execute each of the operation of the transaction. 

Serialisable schedule: it is a kind which is used to find the non serial transactions and will allow transaction to be executed without disturbing other operations

Questions

  1. What is state chart diagram? Explain
  2. Draw the sequence diagram for the database of the university.
Share this article