SlideShare a Scribd company logo
1 of 29
Arab Open University
2nd
Semester, 2006-2007
M301
Unit 4.4
Interactions
reem.attas@arabou.org.sa
Reem AlAttas © 2
Topic Road Map
 Design by Contract
Starting Dynamic Modeling
Working with Interaction Diagrams
Design Decisions
Reem AlAttas © 3
Design by Contract
The process of developing software based
on the notion of a contract between
objects.
Assertions:
 Pre-conditions.
 Post-conditions.
 Invariants.
Reem AlAttas © 4
Example
Reem AlAttas © 5
Topic Road Map
Design by Contract
 Starting Dynamic Modeling
Working with Interaction Diagrams
Design Decisions
Reem AlAttas © 6
Interaction Diagrams
Sequence diagrams and collaboration
diagrams (known collectively as
interaction diagrams) are notations to help
make and record decisions relating to the
behavior defined for each class.
Reem AlAttas © 7
… Interaction Diagrams
A sequence diagram shows the flow of
messages from object to object as time
passes by.
A collaboration diagram shows the objects
and their links (the structure).
Reem AlAttas © 8
Sequence Diagram (Check In)
Reem AlAttas © 9
Main Elements
Objects  rectangles.
Messages  arrows.
Object’s lifeline  dashed line.
Indication that a particular object is ‘active’
for a given period of time  long rectangle
overlaid on that object’s lifeline.
Reem AlAttas © 10
Notes
The return of flow of control from the
receiver is not normally shown.
If one object sends a message to another,
there should be an association between
the classes and that association requires
managing.
Reem AlAttas © 11
Topic Road Map
Design by Contract
Starting Dynamic Modeling
 Working with Interaction Diagrams
Design Decisions
Reem AlAttas © 12
CASE Tools
Some CASE tools can generate a
collaboration diagram from a sequence
diagram and vice versa  Find out if
StarUML can do this?
Reem AlAttas © 13
Collaboration Diagrams
Reem AlAttas © 14
Numbering System
Why not use a simple numbering system
1, 2, 3 ?
Reem AlAttas © 15
1st
Message Sequence
Reem AlAttas © 16
2nd
Message Sequence
Reem AlAttas © 17
… Numbering System
A message number always contains as its
prefix the number of the message that
gave rise to it.
Reem AlAttas © 18
Comparison
 A collaboration diagram shows the links between
objects (the local structure), whereas a
sequence diagram does not. In a sequence
diagram, the message arrow implies a link
between two objects.
 The time ordering of messages is clear in a
sequence diagram. Some form of numbering is
needed in a collaboration diagram to show which
message comes before or after another.
Reem AlAttas © 19
Parameterized Interactions
Reem AlAttas © 20
Creation and Deletion in Sequence
Diagram
Reem AlAttas © 21
Creation and Deletion in Collaboration
Diagram
 {new} and {destroyed}.
 If you want to show an object’s complete lifecycle in one
interaction, you can use the {transient} constraint.
Otherwise you should treat creation and destruction as
two separate interactions and show them on two
separate collaboration diagrams.
Reem AlAttas © 22
Topic Road Map
Design by Contract
Starting Dynamic Modeling
Working with Interaction Diagrams
 Design Decisions
Reem AlAttas © 23
Naming the Link Manipulation Methods
Reem AlAttas © 24
Indirect Messages
 Suppose that the company needs to collect
information about the ages of all its employees.
Reem AlAttas © 25
Fork
Reem AlAttas © 26
Cascade
Reem AlAttas © 27
Law of Demeter
The Law of Demeter states that a method,
say m, in a class A should not refer to
another class, say B, unless B is the class
of:
 An instance variable used in the method m.
 A parameter to the method m.
 An object created in the method m.
 A global variable used in the method m.
TMA4 – Q4
Thank You!

More Related Content

Viewers also liked

SETAC meeting 2014
SETAC meeting 2014SETAC meeting 2014
SETAC meeting 2014
Sam Supowit
 
ACS Boston seminar presentation 2015
ACS Boston seminar presentation 2015ACS Boston seminar presentation 2015
ACS Boston seminar presentation 2015
Sam Supowit
 
BUENOS AIRES
BUENOS AIRESBUENOS AIRES
BUENOS AIRES
Yuyi Love
 

Viewers also liked (20)

Orange Shirt Day
Orange Shirt DayOrange Shirt Day
Orange Shirt Day
 
Discovery Styleguide V2
Discovery Styleguide V2Discovery Styleguide V2
Discovery Styleguide V2
 
thesis
thesisthesis
thesis
 
Fisica 2 Diana Patricia Lara Aranda
Fisica 2 Diana Patricia Lara ArandaFisica 2 Diana Patricia Lara Aranda
Fisica 2 Diana Patricia Lara Aranda
 
Peterson-Ret
Peterson-RetPeterson-Ret
Peterson-Ret
 
IIA Tasks 3
IIA Tasks 3IIA Tasks 3
IIA Tasks 3
 
From Model to Implementation II
From Model to Implementation IIFrom Model to Implementation II
From Model to Implementation II
 
Mga sinaunang kabihasnan sa asya
Mga sinaunang kabihasnan sa asyaMga sinaunang kabihasnan sa asya
Mga sinaunang kabihasnan sa asya
 
대신리포트_모닝미팅_151001
대신리포트_모닝미팅_151001대신리포트_모닝미팅_151001
대신리포트_모닝미팅_151001
 
MDS_mod
MDS_modMDS_mod
MDS_mod
 
Articolo_Bocelli_
Articolo_Bocelli_Articolo_Bocelli_
Articolo_Bocelli_
 
Modal verbs
Modal verbsModal verbs
Modal verbs
 
SETAC meeting 2014
SETAC meeting 2014SETAC meeting 2014
SETAC meeting 2014
 
Maridajes - Comer con Vino
Maridajes - Comer con VinoMaridajes - Comer con Vino
Maridajes - Comer con Vino
 
ACS Boston seminar presentation 2015
ACS Boston seminar presentation 2015ACS Boston seminar presentation 2015
ACS Boston seminar presentation 2015
 
Trailer analysis
Trailer analysisTrailer analysis
Trailer analysis
 
BUENOS AIRES
BUENOS AIRESBUENOS AIRES
BUENOS AIRES
 
Competencias Unidad 3
Competencias Unidad 3Competencias Unidad 3
Competencias Unidad 3
 
How to reach people in the Mobile Era: Omnichannel or Bust
How to reach people in the Mobile Era: Omnichannel or BustHow to reach people in the Mobile Era: Omnichannel or Bust
How to reach people in the Mobile Era: Omnichannel or Bust
 
Ver to be
Ver to beVer to be
Ver to be
 

Similar to Interactions

se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_
se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_
se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_
WilheminaRossi174
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technology
Saransh Garg
 
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNOOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
KalyaniLokhande5
 

Similar to Interactions (20)

Classes and Associations
Classes and AssociationsClasses and Associations
Classes and Associations
 
Approaches to Software Development
Approaches to Software DevelopmentApproaches to Software Development
Approaches to Software Development
 
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
SOURCE CODE MANAGEMENT SYSTEM (GITHUB)
 
Chap3 slides
Chap3 slidesChap3 slides
Chap3 slides
 
Ch7
Ch7Ch7
Ch7
 
Ch7
Ch7Ch7
Ch7
 
Introduction to Rational Rose
Introduction to Rational RoseIntroduction to Rational Rose
Introduction to Rational Rose
 
Agile Dev. I
Agile Dev. IAgile Dev. I
Agile Dev. I
 
From Model to Implementation I
From Model to Implementation IFrom Model to Implementation I
From Model to Implementation I
 
DZone_RC_RxJS
DZone_RC_RxJSDZone_RC_RxJS
DZone_RC_RxJS
 
se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_
se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_
se_lectures.DS_Store__MACOSXse_lectures._.DS_Storese_
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technology
 
Component based models and technology
Component based models and technologyComponent based models and technology
Component based models and technology
 
IGNOU PERT CPM
IGNOU PERT CPMIGNOU PERT CPM
IGNOU PERT CPM
 
Collaboration Diagram
Collaboration DiagramCollaboration Diagram
Collaboration Diagram
 
Types of UML diagrams
Types of UML diagramsTypes of UML diagrams
Types of UML diagrams
 
Process Quality Management, Human Resources, Quality Assurance
Process Quality Management, Human Resources, QualityAssuranceProcess Quality Management, Human Resources, QualityAssurance
Process Quality Management, Human Resources, Quality Assurance
 
BIM Usage in Construction Industry and An application of Clash Detection and ...
BIM Usage in Construction Industry and An application of Clash Detection and ...BIM Usage in Construction Industry and An application of Clash Detection and ...
BIM Usage in Construction Industry and An application of Clash Detection and ...
 
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNOOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
 
Another Simple but Faster Method for 2D Line Clipping
Another Simple but Faster Method for 2D Line ClippingAnother Simple but Faster Method for 2D Line Clipping
Another Simple but Faster Method for 2D Line Clipping
 

More from Reem Alattas

More from Reem Alattas (20)

Rumble Lights Pitch Deck
Rumble Lights Pitch DeckRumble Lights Pitch Deck
Rumble Lights Pitch Deck
 
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular RobotsNASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
NASA Datanauts Water Cooler Chat: Autonomous Design of Modular Robots
 
She looks just like me 2017
She looks just like me 2017She looks just like me 2017
She looks just like me 2017
 
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space ExplorationNasa Datanauts Water Cooler Chat: Robotics for Space Exploration
Nasa Datanauts Water Cooler Chat: Robotics for Space Exploration
 
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space ExplorationNasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
Nasa Datanauts Water Cooler Chat: Evolutionary Robots for Space Exploration
 
She Looks Just Like Me 2017
She Looks Just Like Me 2017She Looks Just Like Me 2017
She Looks Just Like Me 2017
 
Tran helmet pitch
Tran helmet pitchTran helmet pitch
Tran helmet pitch
 
Evolutionary Algorithms
Evolutionary AlgorithmsEvolutionary Algorithms
Evolutionary Algorithms
 
Evolutionary Robotics
Evolutionary RoboticsEvolutionary Robotics
Evolutionary Robotics
 
Create a Need
Create a NeedCreate a Need
Create a Need
 
Enhancing input on and above the interactive surface
Enhancing input on and above the interactive surfaceEnhancing input on and above the interactive surface
Enhancing input on and above the interactive surface
 
Skinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input SurfaceSkinput: Appropriating the Body as an Input Surface
Skinput: Appropriating the Body as an Input Surface
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup Language
 
Dynamic HTML Event Model
Dynamic HTML Event ModelDynamic HTML Event Model
Dynamic HTML Event Model
 
PHP Scripting
PHP ScriptingPHP Scripting
PHP Scripting
 
DHTML - Dynamic HTML
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
 
Linear Search & Binary Search
Linear Search & Binary SearchLinear Search & Binary Search
Linear Search & Binary Search
 
JavaScript Arrays
JavaScript Arrays JavaScript Arrays
JavaScript Arrays
 
JavaScript Functions
JavaScript Functions JavaScript Functions
JavaScript Functions
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

Interactions

  • 1. Arab Open University 2nd Semester, 2006-2007 M301 Unit 4.4 Interactions reem.attas@arabou.org.sa
  • 2. Reem AlAttas © 2 Topic Road Map  Design by Contract Starting Dynamic Modeling Working with Interaction Diagrams Design Decisions
  • 3. Reem AlAttas © 3 Design by Contract The process of developing software based on the notion of a contract between objects. Assertions:  Pre-conditions.  Post-conditions.  Invariants.
  • 4. Reem AlAttas © 4 Example
  • 5. Reem AlAttas © 5 Topic Road Map Design by Contract  Starting Dynamic Modeling Working with Interaction Diagrams Design Decisions
  • 6. Reem AlAttas © 6 Interaction Diagrams Sequence diagrams and collaboration diagrams (known collectively as interaction diagrams) are notations to help make and record decisions relating to the behavior defined for each class.
  • 7. Reem AlAttas © 7 … Interaction Diagrams A sequence diagram shows the flow of messages from object to object as time passes by. A collaboration diagram shows the objects and their links (the structure).
  • 8. Reem AlAttas © 8 Sequence Diagram (Check In)
  • 9. Reem AlAttas © 9 Main Elements Objects  rectangles. Messages  arrows. Object’s lifeline  dashed line. Indication that a particular object is ‘active’ for a given period of time  long rectangle overlaid on that object’s lifeline.
  • 10. Reem AlAttas © 10 Notes The return of flow of control from the receiver is not normally shown. If one object sends a message to another, there should be an association between the classes and that association requires managing.
  • 11. Reem AlAttas © 11 Topic Road Map Design by Contract Starting Dynamic Modeling  Working with Interaction Diagrams Design Decisions
  • 12. Reem AlAttas © 12 CASE Tools Some CASE tools can generate a collaboration diagram from a sequence diagram and vice versa  Find out if StarUML can do this?
  • 13. Reem AlAttas © 13 Collaboration Diagrams
  • 14. Reem AlAttas © 14 Numbering System Why not use a simple numbering system 1, 2, 3 ?
  • 15. Reem AlAttas © 15 1st Message Sequence
  • 16. Reem AlAttas © 16 2nd Message Sequence
  • 17. Reem AlAttas © 17 … Numbering System A message number always contains as its prefix the number of the message that gave rise to it.
  • 18. Reem AlAttas © 18 Comparison  A collaboration diagram shows the links between objects (the local structure), whereas a sequence diagram does not. In a sequence diagram, the message arrow implies a link between two objects.  The time ordering of messages is clear in a sequence diagram. Some form of numbering is needed in a collaboration diagram to show which message comes before or after another.
  • 19. Reem AlAttas © 19 Parameterized Interactions
  • 20. Reem AlAttas © 20 Creation and Deletion in Sequence Diagram
  • 21. Reem AlAttas © 21 Creation and Deletion in Collaboration Diagram  {new} and {destroyed}.  If you want to show an object’s complete lifecycle in one interaction, you can use the {transient} constraint. Otherwise you should treat creation and destruction as two separate interactions and show them on two separate collaboration diagrams.
  • 22. Reem AlAttas © 22 Topic Road Map Design by Contract Starting Dynamic Modeling Working with Interaction Diagrams  Design Decisions
  • 23. Reem AlAttas © 23 Naming the Link Manipulation Methods
  • 24. Reem AlAttas © 24 Indirect Messages  Suppose that the company needs to collect information about the ages of all its employees.
  • 25. Reem AlAttas © 25 Fork
  • 26. Reem AlAttas © 26 Cascade
  • 27. Reem AlAttas © 27 Law of Demeter The Law of Demeter states that a method, say m, in a class A should not refer to another class, say B, unless B is the class of:  An instance variable used in the method m.  A parameter to the method m.  An object created in the method m.  A global variable used in the method m.