(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
UML Diagrams: State Diagram & Activity Diagram
1. UNIT I UML DIAGRAMS
Introduction to OOAD – Unified Process –
UML diagrams – Use Case – Class Diagrams–
Interaction Diagrams – State Diagrams –
Activity Diagrams –
Package, component and Deployment Diagrams.
2. State Diagram
Describe all of the possible states
that a particular object can get into and
how the object's state changes as a result of events
that reach the object.
3. Overview
• State Diagram Model the dynamic aspect of a system
– Define different states of an object during its lifetime.
– Describes the flow of control from one state to another state.
• A Statechart diagram describes a state machine.
• A state machine can be defined as a machine
– It defines different states of an object and
These states are controlled by external or internal events.
4. Purpose
• To model dynamic aspect of a system.
• To model life time of a reactive system.
• To describe different states of an object during its life time.
• Define a state machine to model states of an object.
5. Points to be Clarified
• Before a Statechart diagram, clarified the following points:
1. Identify important objects to be analyzed.
2. Identify the states.
• A state is the condition of an object at a moment in time—the time between events
3.Identify the events.
An event is a significant or noteworthy occurrence.
For example:
A telephone receiver is taken off the hook
Transition:
• A transition is a relationship between two states that indicates that
when an event occurs, the object moves from the prior state to the
subsequent state.
6. Transitions are shown as arrows, labeled with their event.
States are shown in rounded rectangles.
7. Subject of a Statechart Diagram:
A statechart diagram may be applied to a variety of UML
elements, including:
• classes (conceptual or software)
• use cases
Since an entire "system" may be represented by a class,
it too may have its own statechart diagram.
8. Basic notational elements
• Filled circle
– Represent the initial state
• Hollow circle containing a smaller filled circle,
– Indicate the final state (if any)
• Rounded rectangle
– Denote a state.
• Arrow, denoting transition.
9. How to Draw: State Diagrams
Activity section of the state symbol depicts
what activities the object will be doing while it is in that state.
10. How to Draw: State Diagrams
Conditions based on the activities
can determine what the next state
the object transitions to.
11. Example: State Diagrams
When the object enters the Checking state
it performs the activity "check items."
After the activity is completed the object transitions to next state based on conditions
[all items available] or [an item is not available].
If an item is not available the order is canceled.
If all items are available then the order is dispatched.
In Dispatching state the activity "initiate delivery" is performed.
After this activity is complete the object transitions to the Delivered state.
12. Super-State
• State diagrams can also show a super-state for the object.
• A super-state is used when many transitions lead to the a certain state.
• Instead of showing all transitions from each state to the redundant state
– A super-state can be used to show that all the states inside of the super-state
can transition to the redundant state.
• This helps make the state diagram easier to read.
13. Super-State
• Both Checking and Dispatching states can transition into Canceled state
• So a transition is shown from a super-state named Active to the state
Cancel.
16. Main Usage of State Diagram
1. To model object states of a system.
2. To model reactive system.
– Reactive system consists of reactive objects.
1. To identify events responsible for state changes.
2. Forward and reverse engineering.
18. A UML activity diagram offers rich notation to show
a sequence of activities.
19.
20. Overview
• Activity diagram is used
– To show message flow from one activity to another.
• Activity is a particular operation of the system.
• Purposes of activity diagram can be described as:
– Draw the activity flow of a system.
– Describe the sequence from one activity to another.
– Describe the parallel, branched and concurrent flow of the system.
21. Purpose
• Draw the activity flow of a system.
• Describe the sequence from one activity to another.
• Describe the parallel, branched and concurrent flow of the
system.
22. 05 October, 2007 Information System Design
IT60105, Autumn 2007
Basic Components in an Activity Diagram
• Initial node
– The filled circle is the starting point
of the diagram
• Final node
– The filled circle with a boarder is the
ending point. An activity diagram
can have zero or more activity final
state.
• Activity
– The rounded circle represents
activities that occur. An activity is
not necessarily a program, it may be
a manual thing also
• Flow/ edge
– The arrows in the diagram. No label
is necessary
R e c e iv e d f o r m
P a y m e n t f e e s
H o s t e l
a llo t m e n t
I s s u e id e n t it y
c a r d
M e d ic a l c h e c k
I s s u e lib r a r y
c a r d
23. 05 October, 2007 Information System Design
IT60105, Autumn 2007
Basic Components in an Activity Diagram
• Fork
– A black bar ( horizontal/vertical )
with one flow going into it and
several leaving it. This denotes the
beginning of parallel activities
• Join
– A block bar with several flows
entering it and one leaving it. this
denotes the end of parallel activities
• Merge
– A diamond with several flows
entering and one leaving. The
implication is that all incoming flow
to reach this point until processing
continues
R e c e iv e d f o r m
P a y m e n t f e e s
H o s t e l
a llo t m e n t
I s s u e id e n t it y
c a r d
M e d ic a l c h e c k
I s s u e lib r a r y
c a r d
24. 05 October, 2007 Information System Design
IT60105, Autumn 2007
Basic Components in an Activity Diagram
• Difference between Join and Merge
– A join is different from a merge in that the join synchronizes two
inflows and produces a single outflow. The outflow from a join cannot
execute until all inflows have been received
– A merge passes any control flows straight through it. If two or more
inflows are received by a merge symbol, the action pointed to by its
outflow is executed two or more times
25. 05 October, 2007 Information System Design
IT60105, Autumn 2007
Basic Components in an Activity Diagram
• Decision
– A diamond with one flow
entering and several leaving. The
flow leaving includes conditions
as yes/ no state
• Flow final
– The circle with X though it. This
indicates that Process stop at this
point
• Swim lane
– A partition in activity diagram by
means of dashed line, called
swim lane. This swim lane may
be horizontal or vertical
R e c e iv e d f o r m
P a y m e n t f e e s
H o s te l
a llo t m e n t
I s s u e id e n t it y
c a r d
M e d ic a l c h e c k
I s s u e lib r a r y
c a r d
26. Points to be Clarified
• Before drawing an activity diagram, identify the following
elements:
1. Activities
2. Association
3. Conditions
4. Constraints
• Once these mentioned parameters are identified
– Make a mental layout of the entire flow.
• This mental layout is then transformed into an activity diagram.
27. Main usages of activity diagram
• Modeling work flow by using activities.
• Modeling business requirements.
• High level understanding of the system's functionalities.
• Investigate business requirements at a later stage.
28. Basic Activity Diagram Notations
• A black circle represents the start (initial state) of the workflow;
• An encircled black circle represents the end (final state).
• Rounded rectangles represent actions;
• Diamonds represent decisions;
• Bars represent the start (split) or end (join) of concurrent activities;
Arrows run from the start towards
the end and represent the order in which
activities happen.
30. After receiving the order request
Condition checks are performed to check if it is normal or special order.
After the type of order is identified
Dispatch activity is performed
and that is marked as
the termination of the process