Unified Modelling Language

Slides:



Advertisements
Similar presentations
Object-Oriented Software Engineering Visual OO Analysis and Design
Advertisements

Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
System Sequence Diagrams (SSD). Recap Concepts of Action, Pins and Activity Description of activity nodes and activity edges New notations – Activity.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
THE OBJECT-ORIENTED DESIGN WORKFLOW UML2 Sequence Diagrams.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Chapter 8: Modelling Interactions and Behaviour
Unified Modeling Language (UML)
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
Dynamic modeling using UML
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
C++ Training Datascope Lawrence D’Antonio Lecture 11 UML.
Modeling Dynamic Behavior: Sequence and Collaboration Diagrams.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
SE-565 Software System Requirements More UML Diagrams.
1 Lab Beginning Analysis and Design 4 Completion of first version of use case diagram initiates the processes of analysis and design. 4 UML provides.
Slide 1 Use Case Sequence Diagram. Slide 2 Interaction Diagrams l Interaction diagrams model the behavior of use cases by describing the way groups of.
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
CS3773 Software Engineering
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD.
1 Sequence Diagrams (Based on Stevens and Pooley (2006, Chapters 9, 10) and Fowler (2004, Chapter 4)) David Meredith Aalborg University.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 9: Interaction.
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 UML Sequence Diagrams.
1 Modeling interactions and behavior Lecturer Dr. Mai Fadel.
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
1 UML Sequence Diagrams UML Distilled, Third Edition, Chapter 4 M. Fowler.
Sequence diagram in UML Martin Palkovik. Sequence diagram  It is a graphic representation of system operations based on chronology - a time sequence.
M Taimoor Khan Sequence Diagrams Illustrates how objects interacts with each other. Emphasizes time ordering of messages.
Discovering object interaction. Use case realisation The USE CASE diagram presents an outside view of the system. The functionality of the use case is.
Course Instructor: Kashif Ihsan 1. Chapter # 3 2.
System sequence diagram M Taimoor Khan
CSCI-383 Object-Oriented Programming & Design Lecture 12.
7. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Detailed Object-Oriented Requirements Definitions  System Processes—A Use.
1 START AT 31 MARCH END 8 APRIL PHASE5(CONCEPTUAL AND SEQUENCE MODEL)
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
Chapter 3: Introducing the UML
UML Class Diagrams Sequence Diagrams CSE230 Dae-Kyoo Kim.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
1 Kyung Hee University Interaction Diagrams Spring 2001.
Project 2: Phase 1 Submission 7 Late submissions 10% 10 No submissions 14% Better than project 1 phase 3 submissions 10-point bonus: If you catch the deadline.
Interactions.
Collaboration Diagrams
UML SEQUENCE DIAGRAM.
Sequence Diagrams Mimi Opkins CECS 493 Fall2016
Sequence Diagrams.
Chapter 11: Collaboration Diagram - PART1
Prepared By Sidra Noureen
Behavioral Modeling.
Sequence Diagrams.
Interactions.
UML Sequence Diagrams.
Requirements To Design In This Iteration
Princess Nourah bint Abdulrahman University
System Sequence Diagrams
Classification of UML Diagrams
Sequence Diagrams.
IMAT5205 Systems Analysis and Design
Superior University, Lahore
Interaction diagrams.
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Interaction diagrams Interaction diagrams are models that describe how groups of objects collaborate in some behavior. Typically, an interaction diagram.
UML Interaction diagrams
Sequence Diagrams.
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Presentation transcript:

Unified Modelling Language Interaction Diagrams

Interaction Diagrams Interaction diagrams are used to model the dynamic aspects of a software system They help you to visualize how the system runs. An interaction diagram is often built from a use case and a class diagram. The objective is to show how a set of objects accomplish the required interactions with an actor.

Elements found in interaction diagrams Instances of classes Shown as boxes with the class and object identifier underlined Actors Use the stick-person symbol as in use case diagrams Messages Shown as arrows from actor to object, or from object to object

Creating interaction diagrams You should develop a class diagram and a use case model before starting to create an interaction diagram There are two kinds of interaction diagrams: Sequence diagrams Communication diagrams

Sequence Diagrams

Sequence Diagrams Dynamic Model relating use cases and class diagrams Illustrates how objects interacts with each other Shows time ordering of interactions Generally a set of messages between collaborating objects Can model simple sequential flow, branching, iteration, recursion and concurrency

member: LibraryMember A Sequence Diagram member: LibraryMember book:Book :Book Copy borrow(book) ok = mayBorrow() [ok] borrow(member) setTaken(member)

member: LibraryMember A Sequence Diagram X-Axis (objects) member: LibraryMember book:Book :Book Copy Object borrow(book) Life Line ok = mayBorrow() Y-Axis (time) message Activation box [ok] borrow(member) setTaken(member) condition

Representing objects squares with object type, optionally preceded by object name and colon write object's name if it clarifies the diagram object's "life line" represented by dashed vert. line Name classes consistently with your class diagram (same classes) Include instance names when objects are referred to in messages or when several objects of the same type exist in the diagram

Messages between objects A message is represented by an arrow between the life lines of two objects A message call is a request from the object sending the message to the object receiving the message. The request is for the receiver to carry out one of its (the receiver’s) operations Self calls are also allowed The time required by the receiver object to process the message is denoted by an activation-box A message is labeled at minimum with the message name Arguments and control information (conditions, iteration) may be included

Messages between objects dashed arrow back indicates return Return Values Optionally indicated using a dashed arrow with a label indicating the return value. Don’t model a return value when it is obvious what is being returned, e.g. getTotal() Model a return value only when you need to refer to it elsewhere, e.g. as a parameter passed in another message. Prefer modeling return values as part of a method invocation, e.g. ok = isValid()

Object Creation An object may create another object via a <<create>> message. :A :B <<create>> Constructor Preferred :A <<create>> :B

Object Destruction An object may destroy another object via a <<destroy>> message. An object may destroy itself. Avoid modeling object destruction unless memory management is critical. :A :B <<destroy>>

Control information Condition Iteration syntax: ‘[‘ expression ’]’ message-label The message is sent only if the condition is true example: Iteration syntax: * [ ‘[‘ expression ‘]’ ] message-label The message is sent many times to possibly multiple receiver objects. [ok] borrow(member)

The syntax of expressions is not a standard Control Information (Cont.) Iteration examples: :CompoundShape :Shape :Driver :Bus draw() *draw() *[until full] insert() The syntax of expressions is not a standard

Indicating selection and loops frame: box around part of a sequence diagram to indicate selection or loop if -> (opt) [condition] if/else -> (alt) [condition], separated by horiz. dashed line loop -> (loop) [condition or items to loop over] [ balance <> ] opt < 100 . 00 > = alt loop

Sequence Diagram (Basics) Object : Class or Actor Lifeline name Focus of Control/ Activation message Object Destruction/ Termination X <<create>> <<destroy>>

Example 1

Example 2

Example 3

Example 4

Example 5

Collaboration (or Communication) Diagrams

Collaboration Class diagrams indicate what classes are part of our system, what they offer, how they relate, but they don’t tell us how they communicate Collaboration diagrams show how objects interact and their roles The elements of a Collaboration diagram are essentially the same as that of a Sequence diagram Actually they are considered as a cross between class and sequence diagram Sequence Diagrams are arranged according to Time Collaboration Diagrams represent the structural organization of object

Elements of a Collaboration diagram Element and its description Symbol Object: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined.                           Relation/Association: A link connecting the associated objects. Qualifiers can be placed on either end of the association to depict cardinality.                                        Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. The number represents the order/sequence of this interaction.                              

Symbols used in collaboration diagrams

Example Class diagram for “Courseware Management System”

Example Sequence diagram for the"Manage course information" flow

Example Collaboration diagram for the "Manage course information" flow

When to Use Interaction Diagrams You should use interaction diagrams when you want to look at the behavior of several objects within a single use case Interaction diagrams are good at showing collaborations among the objects If you want to look at the behavior of a single object across many use cases, use a state diagram

How to choose between using a sequence or communication diagram? Sequence diagrams Make explicit the time ordering of the interaction. Use cases make time ordering explicit too So sequence diagrams are a natural choice when you build an interaction model from a use case. Make it easy to add details to messages. Communication diagrams have less space for this Communication diagrams Can be seen as a projection of the class diagram Might be preferred when you are deriving an interaction diagram from a class diagram. Are also useful for validating class diagrams.