11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.
-
Upload
alyson-thornton -
Category
Documents
-
view
214 -
download
2
Transcript of 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.
![Page 1: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/1.jpg)
11
Software EngineeringDr. K. T. Tsang
Lecture 6
Interaction Diagramshttp://www.uic.edu.hk/~kentsang/SWE/SWE.htm
![Page 2: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/2.jpg)
2
Interaction diagrams
• Sequence diagrams – ordered by time– Shows the flow of logic through a scenario
• Collaboration diagrams – shows the communications among objects– Use to assess the impact of interactions
• Activity diagrams – focuses on the flow of activities, useful for understanding complex procedures
![Page 3: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/3.jpg)
3
Sequence diagrams
• Describe the time sequence of interactions among classes
• Contain these elements:– Class roles– Lifelines– Activations– Messages
• B&R 7.2
![Page 4: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/4.jpg)
4
Example class model ..1
Project
Activity
Resource Task
1
1
1
1..*
1..*
* Assigned to
Filled diamond – composition relationship
![Page 5: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/5.jpg)
5
Example class model ..2
Skill
Resource
Hourly Salaried
Resource-Skill
*
*
![Page 6: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/6.jpg)
6
Sequence diagrams Example ..1
Res Manager Win:UserInterface :Resource :Skill :Resource-skill
:Resource Manager
Find resource by name
Find resource
Find skill
assign skill to resource
Find skill by name
Assign skill to resource
[Resource is not assigned skill]
![Page 7: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/7.jpg)
7
Proj Manager Win:UserInterface :Project :Activity :Task
:Project Manager
Find project by name
Remove project
Find activity by project
Remove task
Find task by activity
Remove activity
Remove project
No more task
No more activity
Sequence diagrams Example ..2
![Page 8: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/8.jpg)
8
Collaboration diagrams
• Describe interactions among classes and associations
• Contains these elements– Class roles– Association roles– Messages flows
![Page 9: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/9.jpg)
9
Collaboration diagrams Example ..1
![Page 10: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/10.jpg)
10
Collaboration diagrams Example ..2
![Page 11: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/11.jpg)
11
Collaboration diagrams Example: Remove project
![Page 12: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/12.jpg)
12
Activity diagrams
• Shows the sequence of steps that make up a complex process, like a flowchart
• Shows flows of control similar to a sequence diagram, but focuses on operation rather than on objects
• Each activity is represented by an elongated ovals
p.140, 7.3; p.155, 8.3 B&R
![Page 13: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/13.jpg)
13
Activity diagrams : example 1
![Page 14: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/14.jpg)
14
• Branches – Symbol : Hollow diamond– Condition [square bracket]
• Initiation & Termination – solid circle, a bull’s eye (a solid circle surrounded by a a hollow circle)
• Concurrent activities– One activity can be split into several concurrent activities
(a fork of control)– Then be combined into a single activity (a merge of
control)– A fork or a merge is shown by a synchronization bar (a
heavy line with arrows coming in or out of it)
Activity diagrams .. 2
![Page 15: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/15.jpg)
15
Activity diagrams : example 2
![Page 16: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/16.jpg)
16
• Sending & receiving signals– Convex pentagon, sending– Concave pentagon, receiving
• Swimlanes – shows organizational responsibility for activities
Activity diagrams .. 3
![Page 17: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/17.jpg)
17
Activity diagrams
Sending & receiving signals
![Page 18: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/18.jpg)
18
flight attendant Ground crew Catering
Activity diagrams: Swimlanes
![Page 19: 11 Software Engineering Dr. K. T. Tsang Lecture 6 Interaction Diagrams kentsang/SWE/SWE.htm.](https://reader035.fdocuments.us/reader035/viewer/2022070410/56649f0c5503460f94c1f11d/html5/thumbnails/19.jpg)
19
Reading for this lecture
• Chapter 7 & 8, Blaha & Rumbaugh
• Study the interaction diagrams in the examples– http://www.cs.gordon.edu/courses/cs211/
AddressBookExample/index.html– http://www.cs.gordon.edu/courses/cs211/
ATMExample/index.html