Вы находитесь на странице: 1из 9

2/22/2013

1
Interaction Modeling
INTRODUCTION
The interaction model is one of the important
part of modeling and describe interactions
within a system.
It describe how objects interact to produce
useful results. whereas the state model
reductionist view of behavior that examine
each object individually.
CONTD
Interaction can be modeled at different level of
abstraction .
Usecase: how system interact with outside users.
Sequence: provide more detail and show messages
exchange among the set of object over time.
Activity: provide further detail and show the flow of
control among step of a computation. It shows
dataflow as well as control flow.
USE CASE MODEL
Use case manly divide into two things.
Actor:
Use case.
2/22/2013
2
Actor
Actor is a direct external user of a system- an
object or set of objects that communicates
directly with the system but that is not part of
the system .
Each actor represents those objects that
behave in a particular way towards the system
Actor can be a person device or other system
anything that directly interact with the
system.
CONTD
For example,
System Actors
Vending machine Technician, customer
Travel agency Airline, traveler, agent
Computer database system User, Administrator
Library system Student, technician, sock
cleark
CONTD
An object can be bound to multiple actors if it
has different facts and behavior.
For example, Paul can be a customer as well as
technician for vending machine.
Modeling the actor is help to defined syatem
by identifying the objects within a system and
those on its boundary.
USE CASE
The various interaction of actors with a system
are quantized into use cases.
A use case is a coherent pieces of functionality
that a system can provide by interacting with
actors.
For example, a customer actor can buy a
beverages from a vending machine.
2/22/2013
3
USE CASE DIAGRAM NOTATION
System : rectangle name of system may be
written near side of the rectangle
Use case: a name within ellipse
Actors: stick man icon
Inclusion
Inclusion enables to reuse one use case's steps inside another
use case.
Extension
Allows creating a new use case by adding steps to existing use
cases
Generalization
Allows child use cases to inherit behavior from parent use cases
2/22/2013
4
EXAMPLE
Restock
Close Machine
Open Machine
<<includes>>
<<includes>>
Restock According
to Sales
<<extends>>
GUIDELINES FOR USE CASE DIAGRAM
First determine the system boundary.
Ensure that actors are focused
Each uses case must provide value to users.
Relate use cases and actors.
Remember that use cases are formal.
Use case can be structured.
SEQUNCE MODELS
The sequence model elaborates the themes of
use case.
Two kind of sequence models
Scenarios
A more structured format called sequence
diagrams.
SCENARIOS
a scenario is a sequence of events that occurs
during one particular execution of a system
such as for a use case.
The scope of scenarios can vary.
a scenarios can be displayed as a list of text
statement.
A scenarios contain messages between
objects as well as activities performed by each
objects.
2/22/2013
5
SEQUENCE DIAGRAM
A text format is convenient for writing, but it
does not clearly show the sender and receiver
of each message, especially if there are more
than objects.
A sequences diagram shows the participants
in an interaction and sequence of message
among them
A sequences diagram shows the interaction of
system with its actors to perform all or part of
a use case.
CONTD
Each use case requires one or more sequence
diagrams to describes its behavior. each sequence
diagram show particular behavior sequence of
the use case.
Large scale interaction contain many independent
tasks that can be combined in various way. There
can be a separate sequence diagram for each
task.
A sequence diagram should also be prepared for
each exception condition within the use case.
2/22/2013
6
CONTD
In most system, there are unlimited number of
scenarios, so it is not possible to show them
all. But we should try to elaborate all the use
cases and cover basic kind of behavior with
sequence diagrams.
It necessary to show all combinations of
activities ,once basic pattern is established.
2/22/2013
7
GUIDELINES FOR SEQUENCE DIAGRAM
Prepare at least one scenarios per use case.
Abstract the scenarios into sequence diagrams
Divide each complex interaction.
Prepare sequence diagram for each error
condition.
ACTIVITY MODELS
An activity diagram shows the sequence of steps
that make up a complex process ,such as an
algorithm or workflow.
An activity diagram shows flow of control, similar
to a sequence diagram, but focus es on operation
rather than objects
An activity diagram is like a traditional flowchart
in that it shows the flow of control from step to
step. Unlike a traditional flowchart, however an
activity diagram can show both sequencial and
concurrent flow of control
ACTIVITES
The step of a activity diagram are operation,
specifically activities from the state model
Some activities run forever until an outside
event interrupts them, but most of activities
are eventually complete their work and
terminated themselves.
The completion of one activity usually indicate
that next activity can be started.
An activity can be decomposed into finer
activities.
2/22/2013
8
BRANCHES
If there is more than one successor to an activity,
each arrow may be labeled with a condition in
square brackets or example [failure] .
If one condition is satisfied its arrow indicates the
next activity to perform.
A diamond shows a branch into multiple
successors. The diamond has one incoming arrow
and two outgoing arrows, each with a condition.A
particulur execution chooses only one path of
control.
INITIATION & TERMINATION
A solid circle with an outgoing arrow shows
the starting point of an activity diagram.
When activity diagram is activated , control
starts at the solid circle and proceed via
outgoing arrow toward the first activities.
A bulls eyes show the termination with having
only one incoming arrow of activity diagram.
EXECUTABLE ACTIVITY DIAGRAM
Activity diagram also be used to show the
progression of control during execution . An
activity tokens can be placed on an activity
symbol to indicate that is executing. When an
activity is complete the token is removed and
placed on the outgoing arrow.
When there is more than one outgoing arrow
with conditions, the condition are examined
and to determine successor activity. Only one
successor can get tokens.
SWIMLANES
Activity diagram tell you what happen but
they do not tell you who does what. So it is
not convey which class is not responsible for
each actions.
So Activity provide another ability t clarify
which actor perform which activity . This can
be done by swimlanes.
Swimlanes analogy come from swimming
pool.
2/22/2013
9
CONTD
Placing an activity into particular swimlanes
indicate that it is performed by person or
person with in the organization.
Line across swimlane boundary indicate
interaction among different an organizations
which must usually treated with more care
than interaction within an organization .
The horizontal arrangement of swimlanes has
no inherent meaning But order has meaning.
GUIDELINES FOR ACTIVITY DIAGRAM
Dont misuse activity diagram.
Level diagram
Be careful with branches and conditions
Be careful with concurrent activites.
Consider executable activity diagram.
THE END

Вам также может понравиться