Professional Documents
Culture Documents
0
0
0
Lab 10: Modeling of Objects states using state diagram
Objectives
1. Outline
UML state diagrams.
UML state diagram notation
UML state details
Examples
2. Background
Mainly, we use interaction diagrams to study and model the behavior of
objects in our system. Sometimes, we need to study the behavior of a
specific object that shows complex behavior to better understand its
dynamics. For that sake, UML provides state transition diagrams used to
model the behavior of objects of complex behavior. In this Lab, UML
state transition diagrams will be introduced. We will study their notation
and how can we model them using Rational Rose.
2.1 UML State Diagrams
State diagrams show how one specific object changes state as it
receives and processes messages:
A State transition diagram shows the lifecycle of an object
A state is a condition of an object for a particular time
An event causes a transition from one state to another state
Here is a State chart for a Phone Line object:
States in rectangle with rounded corners, Transitions as
arrows
In the operations part, we usually use one of the following reserved words:
o Entry: a specific action performed on the entry to the state.
o Do: an ongoing action performed while in the state.
o On: a specific action performed while in the state.
o Exit: a specific action performed on exiting the state.
There are two special states added to the state transition diagram- start state
and end state.
Notation of start state is a solid black circle and for the end state a bull’s eye is
used.
3. CASE Tools
Visual Paradigm, Rational Rose, Star UML etc.
4. In-Class Example
Now you will learn how to apply the above mentioned methods of
drawing state transition diagrams (STD).
Lab Task 1
Draw a state diagram for a claim
A third party claim arises from an incident that has occurred. The claim must be
reported to the claims office within the statutory period to be valid. When the
claim is reported, the incident is preferably verified by a member of staff who was
present at the time. The claim is recorded and evaluated. If it is a trivial claim,
the claims assessor checks the claimant for previous claims and, if there are no or
1 previous claims then a payment is made and the claim is settled. If there are
previous claims, the claimant will be referred to the courts. More serious claims
may await expert evidence and several different court hearings. At any stage, the
claim may be dropped, or a payment made without admitting liability. If the
claimant is a minor, the claim must remain on the books until the claimant is over
21. If a claim is settled by a court, it may be appealed. During this time, the
claim remains open.
Lab Task 2
OTOS’s pharmacy is the distributer of various pharmaceuticals products. They
have a huge network of customers. The registered customers can only book orders
for the specified product. If the specified product s available the required quantity
is checked against the quantity on hand (QOH). If the required quantity is less
than QOH a deliver challan is prepared. After the delivery of the product an
Invoice is prepared by accountant who contains the cost of ordered items,
deductions if any (in case of damaged or lost goods) and previous outstanding
balance. Then the invoice is sent to the customer. Draw state diagram.
6. Deliverables
You should use these techniques to create state transition diagrams for above
tasks.