Unformatted text preview: Computer Software Engineering
Lecture # 7
Object oriented Design
UML Interaction Diagrams
(Sequence, Collaboration and State Chart
Diagrams) Sequence Diagram A sequence diagram provides a detailed view of a
use case. It shows an interaction arranged in a sequence over
time. It helps document the flow within the application. In a comprehensive software system, the sequence
diagram can be quite detailed, and can include
thousands of messages.
02/26/12 Elements of the Sequence Diagram
Elements Objects appear along the top margin Each object has a life line , a dashed line that
represents the life of the object
represents A focus of control- is a tall, thin rectangle that
sits on top of an object’s lifeline
sits Messages that show the actions that objects
perform on each other and on themselves.
02/26/12 3 Sequence Diagram Basics
Object 1 Object 2 Object 3 message() Message
Activation Box Return Deletion
02/26/12 X Lifeline
4 Security System Example
system ready Control Panel System enters passcode
ready for activation
request light on
ready for next action 02/26/12
02/26/12 5 Benefits of using UML Sequence
Diagrams Allow the software engineer to flesh out details before
implementation. Useful tools to find architectural, interface and logic
problems early in the design process. Allows software engineer to validate architecture,
interfaces, and logic by exploring how the system
architecture would handle different basic scenarios and
special cases. It forces the software engineer to think about details
such as interfaces, states, message order, assignment
of responsibilities, and special/error cases ahead of
02/26/12 6 Benefits of using UML Sequence
Diagrams Valuable collaboration tools during design meetings
because they allow software engineer to discuss the
design in concrete terms. To document the dynamic view of the system design
at various levels of abstraction, which is often difficult
to extract from static diagrams or even the complete
source code. Can abstract much of the implementation detail and
provide a high level view of system behavior.
02/26/12 7 Collaboration Diagrams UML collaboration diagram is a
diagram, that focus on the organization
of the objects that participate in a given
set of messages.
set They show objects and messages, but
no lifelines or focus of control
02/26/12 8 Collaboration Diagrams
Continues.. A collaboration diagram is another type of
interaction diagram. Like a sequence diagram, it shows how a
group of objects in a use case work with
one another. Each message is numbered to document
the order in which it occurs.
02/26/12 9 Collaboration Diagrams
02/26/12 10 State Chart Diagrams Very similar to those in Structured Analysis Describe the lifecycle of an object
– All the possible states of an object
– How the object’s state changes as a result of
events that reach the object
events Good at describing the behaviour of an object
across several use cases
across Use state diagrams only for classes that exhibit
02/26/12 11 State Chart Diagram Continues..
Shows the following:
–The life history of a given class –The
The events that cause a transition from one
state to another
–The actions that result from a state change –State
State charts are created for objects with
significant dynamic behavior
02/26/12 12 State Chart Diagram
Add student[ count < 10 ]
Initialization Add Student /
Set count = 0 Open Cancel
Cancel [ count = 10 ] Canceled
02/26/12 Closed 13 Summary
Use collaboration and sequence diagrams to: Capture the behaviour of a single use case.
Show collaborations among objects.
Show Use state chart diagrams to: Describe the behaviour of an object across
several use cases.
02/26/12 classes that exhibit interesting behaviour.
14 USE CASE Driven… A use case leads to a sequence diagram The sequence diagram is used to allocate
behavior among objects mentioned in the use
case. This behavior becomes methods These methods becomes operations on the
02/26/12 15 What is Next More On UML Class and Sequence Diagrams Continue on the SDD & Implementation 02/26/12
02/26/12 16 ...
View Full Document
- Spring '11
- sequence diagram, software system, Object Oriented, software engineer