Lab Manual 04 - 03-11-2022

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Usman Institute of Technology

Department of Computer Science


Course Code: SE308
Course Title: Software Design and Architecture
Fall 2022

Lab 04

OBJECTIVE: Working with the UML Activity Diagrams and State Transition Diagrams

Student Information

Student Name

Student ID

Date

Assessment

Marks Obtained

Remarks

Signature
Modeling with Activity Diagram

The following elements are available in an activity diagram.

1. Activity node
Activities can be broken down further

2. Initial node
Start of the execution of an activity

3. Activity final node


End of ALL execution paths of an activity

4. Flow final node


End of ONE execution path of an activity

5. Decision node
Splitting of one execution path into two or more alternative execution paths

6. Merge node
Merging of two or more alternative execution paths into one execution path

7. Parallelization node
Splitting of one execution path into two or more concurrent execution paths

8. Synchronization node
Merging of two or more concurrent execution paths into one execution path
9. Edge
Connection between the nodes of an activity

10. Partition
Grouping of nodes and edges within an activity

11. Send signal action


Transmission of a signal to a receiver

12. Asynchronous accept (time) event action


Wait for an event E or a time event T
Students Task
1. Draw activity diagram of online railway reservation

The two actors would be a customer and a ticket counter having following activities.

 Search train
 Check availability of train (if yes go to book ticket, if no go to quit)
 Quit
 Book ticket
 Fill details
 Submit details
 Make payment
 Print Ticket
 Cancel ticket
 Get refund

2. Draw activity diagram of patient management system having two actors Receptionist and
Doctor. (e.g. Appointment Management System)
State Transition Diagrams

1. State
Description of a specific “time span” in which an object finds itself during its “life
cycle”. Within a state, activities can be executed on the object.

2. Transition
State transition e from a source state S to a target state T

3. Initial state
Start of a state machine diagram

4. Final state
End of a state machine diagram

5. Terminate node
Termination of an object’s state machine diagram

6. Decision node
Node from which multiple alternative transitions can proceed

7. Parallelization node
Splitting of a transition into multiple parallel transitions

8. Synchronization node
Merging of multiple parallel transitions into one transition
Students Task
1. Consider the bank account system where a bank account in either is Active or Dormant
(inactive). If it is active, it could be either with zero balance or with some funds.

Create State Machine Diagram of the above banking system, mention all events and
possible guards. Also include appropriate Entry, Do and Exit activities.

2. Consider the Scenario of Payroll Application

 The manager first login and the system check the required credential provide by the
manager.
 It authenticates and if it is successful, it moves to the next state where the manager
can add employee.
 If the authenticate fails, it moves to a state where it again ask to reenter the credentials.
 The manager can add employee and move to record deletion state or the report
generation state or payment calculation state.
 For payment calculation, the manger gives the requirements and system
calculates the payments.
 The report generation state generate report for manager which is followed by
updating state where all the records of an employee is updated
 The payment calculation state goes to error recovery state in case of error. after
deletion of record state or updating of record state, the system ends the operation.

States detail are as below.

Idle: when no operation is performing in the system.

Admin Login: The manager logs and the system


Retry login: if login fail, this state gives chance to retry login again

Adding employee: this state add employee and their detail.


Adding new record: creates new employee.

Deleting record: Delete records of employee

Report Generation: Generate reports

Payment calculation: Calculate payment of employee


Error Recovery: If error occurs, this state helps to recover that state

Update Record: Updates records of an employee.

Create State Machine Diagram of the above Payroll Application, mention all events and
possible guards. Also include appropriate Entry, Do and Exit activities.

You might also like