0% found this document useful (0 votes)
65 views

Behavioral Modeling: - Interaction Diagrams

Behavioral modeling uses interaction diagrams like sequence diagrams and collaboration diagrams to model the dynamic aspects of systems. Sequence diagrams emphasize the time ordering of messages while collaboration diagrams emphasize the structural organization of objects. Both use objects, links, and messages. Activity diagrams are also used, showing flows of control between activities. States, transitions, branches, and swimlanes are common elements.

Uploaded by

Pallavi Bharti
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Behavioral Modeling: - Interaction Diagrams

Behavioral modeling uses interaction diagrams like sequence diagrams and collaboration diagrams to model the dynamic aspects of systems. Sequence diagrams emphasize the time ordering of messages while collaboration diagrams emphasize the structural organization of objects. Both use objects, links, and messages. Activity diagrams are also used, showing flows of control between activities. States, transitions, branches, and swimlanes are common elements.

Uploaded by

Pallavi Bharti
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

Behavioral Modeling

• Interaction Diagrams : Sequence diagrams and collaboration


diagrams both of which are called interaction diagrams are two of the five
diagrams used in the UML for modeling the dynamic aspects of systems.

• An interaction diagram shows an interaction, consisting of a set of objects and


their relationships, including the messages that may be dispatched among them.

• A sequence diagram is an interaction diagram that emphasizes the time


ordering of messages; Graphically, a sequence diagram is a table that shows
objects arranged along the X axis and messages, ordered in increasing time,
along the Y axis.


Interaction diagram
• A collaboration diagram is an interaction diagram that emphasizes the
structural organization of the objects that send and receive messages.

• Graphically, a collaboration diagram is a collection of vertices and arcs.


• Common Properties: An interaction diagram is just a special kind of
diagram and shares the same common properties as do all other
diagrams• a name and graphical contents that are a projection into a
model.
• Contents: Interaction diagrams commonly contain
· Objects
· Links
· Messages
Sequence Diagrams
• A sequence diagram emphasizes the time ordering of messages. form a
sequence diagram by first placing the objects that participate in the
interaction at the top of diagram, across the X axis. Typically, you place
the object that initiates the interaction at the left, and increasingly more
subordinate objects to the right. Next, you place the messages that these
objects send and receive along the Y axis, in order of increasing time from
top to bottom.
• Sequence diagrams have two features that
distinguish them from collaboration diagrams.

• First, there is the object lifeline. An object lifeline is the


vertical dashed line that represents the existence of an object
over a period of time.

• Second, there is the focus of control. The focus of


control is a tall, thin rectangle that shows the period of time
during which an object is performing an action,
Collaboration Diagrams
• A collaboration diagram emphasizes the organization of the objects that
participate in an interaction. you form a collaboration diagram by first
placing the objects that participate in the interaction as the vertices in a
graph. Next, you render the links that connect these objects as the arcs of
this graph. Finally, you adorn these links with the messages that objects
send and receive.
• Collaboration diagrams have two features that
distinguish them from sequence diagrams.

• First, there is the path. To indicate how one


object is linked to another

• Second, there is the sequence number. To


indicate the time order of a message,
Activity Diagrams
• Activity diagrams are one of the five diagrams in the UML for modeling
the dynamic aspects of systems. An activity diagram is essentially a
flowchart, showing flow of control from activity to activity.

• You use activity diagrams to model the


dynamic aspects of a system.
Example – Activity Diagram
• Common Properties : An activity diagram is just a special
kind of diagram and shares the same common properties as do all other
diagrams a name and graphical contents that are a projection into a
model.

• Contents : Activity diagrams commonly contain


• Activity states and action states
• Transitions
• Objects
Action States and Activity States

• Action states can't be decomposed. Furthermore, action states are


atomic, meaning that events may occur, but the work of the action state
is not interrupted. Finally, the work of an action state is generally
considered to take insignificant execution time.
• In contrast, activity states can be further decomposed, their activity being
represented by other
• activity diagrams. Furthermore, activity states are not atomic, meaning
that they may be
• interrupted and, in general, are considered to take some duration to
complete.
Transitions

• When the action or activity of a state completes, flow of control passes


immediately to the next action or activity state. You specify this flow by
using transitions to show the path from one action or activity state to the
next action or activity state.
• In the UML, you represent a transition as a simple directed
line,
Branching

• you represent a branch as a diamond. A branch may have one incoming


transition and two or more outgoing ones. On each outgoing transition,
you place a Boolean expression, which is evaluated only once on entering
the branch.
Forking and Joining

• A fork may have one incoming transition and two or more outgoing
transitions, each of which represents an independent flow of control.
• A join represents the synchronization of two or more concurrent flows of
control. A join may have two or more incoming transitions and one
outgoing transition.
Example- Fork and Join
Swimlanes

• You'll find it useful, especially when you are modeling


workflows of business processes, to partition the activity
states on an activity diagram into groups, each group
representing the business organization responsible for those
activities. In the UML, each group is called a swimlane
Example- Swimlane
State Diagram
• A state machine is a behavior that specifies the sequences of states an
object goes through during its lifetime in response to events, together
with its responses to those events.
• A state is a condition or situation during the life of an object during
which it satisfies some condition, performs some activity, or waits for
some event.
• An event is the specification of a significant occurrence that has a
location in time and space. In the context of state machines, an event is
an occurrence of a stimulus that can trigger a state transition.
• A transition is a relationship between two states indicating that an
object in the first state will perform certain actions and enter the second
state when a specified event occurs and specified conditions are satisfied.
Example
States

• A state is a condition or situation during the life of an object


during which it satisfies some condition, performs some
activity, or waits for some event.
• A state has several parts.
Transitions
• A transition is a relationship between two states indicating
that an object in the first state will perform certain actions
and enter the second state when a specified event occurs and
specified conditions are satisfied.
• A transition has five parts.
Substates
• A simple state is a state that has no substructure. A state that
has substates that is, nested states is called a composite
state. A composite state may contain either concurrent
(orthogonal) or sequential (disjoint) substates.
• Sequential Substates:
History State
• A history state allows a composite state that contains
sequential substates to remember the last substate that was
active in it prior to the transition from the composite state.
Concurrent Substates

You might also like