Upload
akhilthambi123
View
218
Download
0
Embed Size (px)
Citation preview
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 1/30
Slide 1
Behavioral Modeling
Chapter 8
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 2/30
Slide 2
Key Ideas
Behavioral models describe theinternal dynamic aspects of aninformation system that supportsbusiness processes in anorganization
Key UML behavioral models are:sequence diagrams, communicationdiagrams, and behavioral statemachine diagrams
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 3/30
Slide 3
Objectives
■ Rules and style guidelines for sequenceand communication diagrams andbehavioral state machines.
■ Processes used to create sequence andcommunication diagrams and behavioralstate machines.
■ Relationship between the behavioralmodels and the structural and functionalmodels.
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 4/30
Slide 4
BEHAVIORAL MODELS
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 5/30
Slide 5
Purpose of BehavioralModels
Show how objects collaborate tosupport each use case in the
structural modelDepict the internal view of thebusiness process
To show the effects of variedprocesses on the system
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 6/30
Slide 6
Interaction DiagramComponents
ObjectsInstantiation of a class
Has attributes that describe anobject
Operations
Send and receive messagesMessages
Tell object to execute a behavior
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 7/30
Interaction Diagrams
Two types:
Sequence Diagrams
Communication Diagrams
Slide 7
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 8/30
Slide 8
Sequence Diagrams
Dynamic model
Illustrate the objects that
participate in a use-caseShow the sequence of messages that pass between
objects for a particular use-caseover time
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 9/30
Sequence Diagram Syntax
Slide 9
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 10/30
Slide 10
Example Sequence Diagram
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 11/30
Slide 11
Building a SequenceDiagram
1. Determine the context of thesequence diagram
2. Identify the participating objects3. Set the lifeline for each object
4. Add messages
5. Add execution occurrence on eachobject’s lifeline
6. Validate the sequence diagram
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 12/30
Slide 12
Normal Flow of Events:
1. Customer submits a search request to the system.2. The system provides the customer a list of recommended CDs.
3. The customer chooses one of the CDs to find additionalinformation.
4. The system provides the customer with basic information & CD Reviews
5. The customer calls the maintain order use case.6. The customer iterates over 3 through 5 until finished shopping.
7. The customer executes the checkout use case.8. The customer leaves the website.
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 13/30
Slide 13
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 14/30
Slide 14
Communication Diagrams
Essentially an object diagram thatshows message passingrelationships instead of aggregation or generalizationassociations.
Emphasize the flow of messagesamong objects, rather than timingand ordering of messages
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 15/30
Slide 15
Communication Diagram Syntax
Actor
Object
Association
Message
Frame
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 16/30
Communication Diagram Syntax
Slide 16
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 17/30
Slide 17
Example Communication Diagram
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 18/30
Slide 18
Steps for buildingCommunication Diagrams
1. Set the context.
2. Identify which objects (actors) and
the associations between the objectsparticipate in the collaboration.
3. Layout the communication diagram.
4. Add messages.5. Validate the communication
diagram.
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 19/30
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 20/30
Slide 20
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 21/30
Slide 21
Behavioral State Machines
The behavioral state machine isa dynamic model that shows
the different states of theobject and what events causethe object to change from one
state to another, along withits responses and actions.
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 22/30
Slide 22
Elements of a BehavioralState Machine
States
Events
TransitionsActions
Activities
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 23/30
Behavioral State Machinediagram syntax
Slide 23
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 24/30
Slide 24
Behavioral State MachineDiagram Syntax
A STATE
AN INITIAL STATE
A FINAL STATE
AN EVENT
A TRANSITION
A Frame
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 25/30
Slide 25
Example Behavioral StateMachine Diagram
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 26/30
Slide 26
Building Behavioral StateMachine Diagrams
Set the context
Identify the initial final, and stable statesof the object
Determine the order in which the objectwill pass through stable states
Identify the events, actions, and guard
conditions associated with the transitionsValidate the statechart diagram
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 27/30
Slide 27
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 28/30
Slide 28
Your Turn
What distinguishes the sequencediagram, the collaboration diagram,and the behavioral state machinediagram?
For what sort of new applicationsmight you need to develop all of
these? Are there any new applicationsthat would not need all of thesediagrams for full development?
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 29/30
Slide 29
Summary
Sequence diagrams illustrate the classes thatparticipate in a use case and the messages thatpass between them.
Communication diagrams provide a dynamicview of the object-oriented system andaccentuate message passing betweencollaborating actors and objects.
Behavioral State Machine diagrams show thedifferent states that a single class passesthrough in response to events.
7/30/2019 08 - Behavioral Modeling
http://slidepdf.com/reader/full/08-behavioral-modeling 30/30
Slide 30
Expanding the Domain
Each year the Association forComputing Machinery (ACM)
sponsors a conference on objectoriented programming. Fordetails about future conferences
and other ACM programs check:http://oopsla.acm.org
http://www.acm.org