Copyright © Hsiao-Lan Wei. 2003 All Rights Reserved Design Model Interaction diagram.

Slides:



Advertisements
Similar presentations
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Advertisements

Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
1 Behavioral Modeling Chapter 8. 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports business processes.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1/20 Interaction Diagrams.
Chapter 1 Object Oriented Analysis and Design. UML, Patterns, and Object-Oriented Analysis and Design  The essential skills for the creation of well-designed,
Lecture 5 …a bit more about UML Sequence diagrams Collaboration diagrams State-chart diagrams CRC cards.
Drawing System Sequence Diagrams
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 5: Restaurant.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Copyright W. Howden1 Lecture 4: Sequence Interaction Diagrams.
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Interaction Diagrams.
Object Collaborations. Objectives: Object Interaction (cont.) You will be able to:  Use sequence diagrams to detail object interactions.
NJIT Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman Presented by Anuradha Dharani.
Use Case Analysis – continued
Sequence Diagrams By Zvika Gutterman Adam Carmi. Sequence Diagrams2 Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control.
Designing with Interaction and Design Class Diagrams Chapters 15 & 16 Applying UML and Patterns Craig Larman With some ideas from students in George Blank’s.
OOAD – Dr. A. Alghamdi Mastering Object-Oriented Analysis and Design with UML Module 6: Use-Case Analysis Module 6 - Use-Case Analysis.
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
INFO 620Lecture #51 Information Systems Analysis and Design Sequence and Collaboration Diagrams INFO 620 Glenn Booker.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Interactions. 2 Objects communicate with each other by sending messages. Sending a message is another name for a member function call. –Some C++ examples.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
1 On to Object Design Chapter 14 Applying UML and Patterns.
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.
1 Interaction diagrams and activity diagrams Speaker: 陳 奕 全 Real-time and Embedded System Lab 15 August 2002.
BTS430 Systems Analysis and Design using UML Interaction Diagrams.
Starting Object Design
Behavioral Modeling Chapter 8.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
1 IBM Software Group ® Mastering Object-Oriented Analysis and Design with UML 2.0 Module 6: Use-Case Analysis.
Collaboration Diagrams CSIS3600. What is a Collaboration Diagram Collaboration diagrams illustrate interactions between objects The collaboration diagram.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
What to remember from Chap 13 (Logical architecture)
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.
Drawing System Sequence Diagrams
Interaction Diagram Notation
Object-Oriented Analysis and Design Feb 11, 2009.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9.
UNIFIED MODELING LANGUAGE(UML) BY Touseef Tahir Lecturer CS COMSATS Institute of Information Technology, Lahore.
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
1 IBM Software Group ® Essentials of Visual Modeling with UML 2.0 Module 5: Interaction Diagrams.
Object Oriented Analysis and Design using the UML Use-Case Analysis Adapted by Dr. Spiegel from Slides Provided by Rational Software.
OO Methodology Elaboration Phase Iteration 1- Part 3.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 5th Edition Copyright © 2015 John Wiley & Sons, Inc. All rights.
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
OOAD Using the UML - Use-Case Analysis, v 4.2 Copyright  Rational Software, all rights reserved 1 Use Case Analysis – continued Control Classes.
1 Kyung Hee University Interaction Diagrams Spring 2001.
1 Object Oriented Analysis System modeling = Functional modeling + Object modeling + Dynamic modeling Functional modeling = Use cases Object modeling =class.
ITEC1301 Object-Oriented Systems Construction Lecture Notes #4 1.
Elaboration popo.
Interactions.
Collaboration Diagrams
UML Interaction Diagrams
Chapter 11: Collaboration Diagram - PART1
Behavioral Modeling.
Princess Nourah bint Abdulrahman University
Interactions.
Requirements To Design In This Iteration
Princess Nourah bint Abdulrahman University
System Sequence Diagrams
Lecture 4: Sequence Interaction Diagrams
Interaction diagrams.
Unified Modelling Language
UML Interaction diagrams
UML Interaction Diagrams
Presentation transcript:

Copyright © Hsiao-Lan Wei All Rights Reserved Design Model Interaction diagram

Copyright © Hsiao-Lan Wei All Rights Reserved 2 Elaboration Iteration 1 On to Object Design (OOD)

Copyright © Hsiao-Lan Wei All Rights Reserved 3 Analysis and Design

Copyright © Hsiao-Lan Wei All Rights Reserved 4 Object-oriented Analysis and Design n Object-oriented analysis – What are the domain objects? Described in a domain object model n Object-oriented design – Describing the software solution in terms of collaborating objects, with responsibilities.

Copyright © Hsiao-Lan Wei All Rights Reserved 5 Transition to Design n During requirements and analysis work, we – “Do the right thing” – Understand the domain – Clarify and record the constraints and requirements – Essentially ignore thinking about the design, and focus on understanding the problem. –... n During design, we – “Do the thing right” – Create a software (and hardware) solution that meets the wishes of the stakeholders.

Copyright © Hsiao-Lan Wei All Rights Reserved 6 From Requirements to Design n A set of requirements-oriented artifacts (and thought) inspire design-oriented artifacts.

Copyright © Hsiao-Lan Wei All Rights Reserved 7 Changing Hats n Until this time, we have been wearing an “investigator” hat, essentially ignoring what the solution should be. – “Do the right thing” n Now, we take off the investigator hat, and put on our “designer” hats. – “Do the thing right” n Of course, in the context of iterative development, we do this repeatedly.

Copyright © Hsiao-Lan Wei All Rights Reserved 8 Objectives of Interaction Diagrams n Learn how to create interaction diagrams to model use-case behavior. n Understand the similarities and differences between sequence and collaboration diagrams.

Copyright © Hsiao-Lan Wei All Rights Reserved 9 So Where Are We? n Discovered boundary, control, and entity classes n Assigned responsibilities to each class n Determined how to use these classes to realize use-case scenarios

Copyright © Hsiao-Lan Wei All Rights Reserved 10 What are Interaction Diagrams? n An interaction diagram is a graphical representation of interactions between objects – It models the dynamic aspects of a system. n There are two kinds of interaction diagrams  Sequence diagrams  Collaboration diagrams n Each provides a different view of the same interaction  Sequence diagrams are time ordered  Collaboration diagrams may include may data flow

Copyright © Hsiao-Lan Wei All Rights Reserved 11 What is a Sequence Diagram? n A sequence diagram shows object interactions arranged in time sequence n The diagram shows  The objects participating in the interaction  The sequence of messages exchanged n A sequence diagram contains:  Objects with their “lifelines”  Messages exchanged between objects in ordered sequence  Focus of control(optional) Sequence Diagrams

Copyright © Hsiao-Lan Wei All Rights Reserved 12 Review: The Anatomy of Sequence Diagrams 1: PerformResponsibility Client Object Supplier Object Message :Client:Supplier Focus of Control This is a sample script. Reflexive Message Object Lifeline 1.1: PerformAnother Responsibility Hierarchical Message Numbering

Copyright © Hsiao-Lan Wei All Rights Reserved 13 A sequence Diagram : Register: Sale makePayment(cashTendered) : Payment create(cashTendered) an activation box showing the focus of control

Copyright © Hsiao-Lan Wei All Rights Reserved 14 What Is a Collaboration Diagram? n A collaboration diagram emphasizes the organization of the objects that participate in an interaction. n The collaboration diagram shows – The objects participating in the interaction. – Links between the objects. – Messages passed between the objects. Collaboration Diagrams

Copyright © Hsiao-Lan Wei All Rights Reserved 15 Sample Collaboration Diagram

Copyright © Hsiao-Lan Wei All Rights Reserved 16 Creating Interaction Diagrams n Use cases are examined to determine the scenarios n Additional information may be needed to complete the scenario  Details of the system that have been omitted from the use case n Example : John enters the student ID number  Question : Where is the id number entered  Answer: Some sort of form is needed Registration form added

Copyright © Hsiao-Lan Wei All Rights Reserved 17 Sequence and Collaboration Diagram Similarities n Semantically equivalent – Can convert one diagram to the other without losing any information n Model the dynamic aspects of a system n Model a use-case scenario

Copyright © Hsiao-Lan Wei All Rights Reserved 18 Sequence and Collaboration Diagram Differences n Collaboration diagrams – Show relationships in addition to interactions – Better for visualizing patterns of collaboration – Better for visualizing all of the effects on a given object – Easier to use for brainstorming sessions n Sequence diagrams – Show the explicit sequence of messages – Better for visualizing overall flow – Better for real-time specifications and for complex scenarios

Copyright © Hsiao-Lan Wei All Rights Reserved 19 Common interaction diagram notation n Classes and instances Sale:Sales1: Sale classinstance named instance

Copyright © Hsiao-Lan Wei All Rights Reserved 20 Basic Sequence Diagram Notation(1/5) n Links – Sequence diagrams do not show links n Messages – Message expression between objects is on an arrowed line. n Focus of control and activation boxes

Copyright © Hsiao-Lan Wei All Rights Reserved 21 Basic Sequence Diagram Notation(2/5) n Creation of instances n Object lifelines

Copyright © Hsiao-Lan Wei All Rights Reserved 22 Basic Sequence Diagram Notation(3/5) n Conditional messages n Mutually exclusive conditional messages : B : A [ x < 10 ] calculate() message1() : C [ x > 15 ] calculate() : Bar : Foo [ color = red ] calculate() message1()

Copyright © Hsiao-Lan Wei All Rights Reserved 23 Basic Sequence Diagram Notation(4/5) n Iteration for a single message n Iteration of a series of messages : Simulator: Random * [i:=1..N]: num := nextInt() runSimulation()

Copyright © Hsiao-Lan Wei All Rights Reserved 24 Basic Sequence Diagram Notation(5/5) n Iteration over a collection (multiobject) n Messages to class objects : Foo list := synchronizedList( aList) message1() java.util.Collections not underlined, therefore a class message to class, or a static method call

Copyright © Hsiao-Lan Wei All Rights Reserved 25 Basic Collaboration Diagram Notation(1/7) n Links – A connection path between two objects – Indicates some form of navigation and visibility – Multiple messages and messages both ways can flow along the same single link 1: makePayment(cashTendered) 2: foo() 2.1: bar() : Register:Sale link line

Copyright © Hsiao-Lan Wei All Rights Reserved 26 Basic Collaboration Diagram Notation(2/7) n Messages – A sequence number is added to show the sequential order of messages – Small arrow with each message indicates the direction of the message – Messages to “self”

Copyright © Hsiao-Lan Wei All Rights Reserved 27 Basic Collaboration Diagram Notation(3/7) n Creation of instances 1: create(cashier) : Register:Sale {new} create message, with optional initializing parameters. This will normally be interpreted as a constructor call. > 1: make(cashier) : Register:Sale {new} if an unobvious creation message name is used, the message may be stereotyped for clarity

Copyright © Hsiao-Lan Wei All Rights Reserved 28 Basic Collaboration Diagram Notation(4/7) n Message number sequencing – The first message is not numbered. – Nesting is denoted by prepending the incoming message number to the outgoing message number 2: makeLineItem(ps, qty) enterItem(id, qty) 1: ps := getSpecification(id) 1.1: ps := get(id) 1.3 [not in specs & specs not full] : put( id, ps) :Register:Sale :Product Catalog :Product Specification UML notation: note the conditional message syntax : LocalProducts IProductsAdapter 1.2 [ not in specs ]: ps := getSpecification(id) specs continued in another diagram

Copyright © Hsiao-Lan Wei All Rights Reserved 29 Basic Collaboration Diagram Notation(5/7) n Conditional messages

Copyright © Hsiao-Lan Wei All Rights Reserved 30 Basic Collaboration Diagram Notation(6/7) n Iteration n Iteration over a collection (multiobject) 1 * [i:=1..N]: num := nextInt() : Simulator runSimulation() : Random iteration is indicated with a * and an optional iteration clause following the sequence number

Copyright © Hsiao-Lan Wei All Rights Reserved 31 Basic Collaboration Diagram Notation(7/7) n Messages to a class object list := synchronizedList( aList ) : InstanceOfFoojava.util.Collections msg1() not underlined, therefore a class message to class, or a static method call