Starting Object Design

Slides:



Advertisements
Similar presentations
Chapter 15 UML Interaction Diagrams 1CS6359 Fall 2012 John Cole.
Advertisements

Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
Interaction Diagram Notation From Chapter 15 of Craig Larman, Applying UML and Patterns John Dalesandro.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Jan Ron McFadyen1 Singleton To guarantee that there is at most one instance of a class we can apply the singleton pattern. Singleton Static.
Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates Each.
Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together to achieve some functionality.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
1 © Wolfgang Pelz UML2 UML Part Two. 2 © Wolfgang Pelz UML2 Chapters Four & Twelve Interaction Diagrams.
Sept Ron McFadyen Interaction Diagrams - Chapter 15 Describe/illustrate sequence of message exchanges among objects that are working together.
Chapter 15 Interaction Diagrams. Most Common Sequence Diagram Communication Diagram Sequence Diagrams illustrate interactions between classes of a program.
Sequence Diagrams By Zvika Gutterman Adam Carmi. Agenda Interaction Diagrams A First Look at Sequence Diagrams Objects Messages Control Information Examples.
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.
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.
SEQUENCE DIAGRAM Prepared by: T. Fatimah Alageel.
UML Sequence Diagrams Reading: UML Distilled Ch. 4, by M. Fowler
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Object-Oriented Analysis and Design Feb 9, 2009.
CSSE 374: Interaction Diagrams Steve Chenoweth Office: Moench Room F220 Phone: (812) These slides and others derived.
מידול התנהגותי 1. Today’s Session Sequence Diagrams State Machines 2.
Interaction diagrams Sequence and collaboration diagrams.
Software Engineering 1 Object-oriented Analysis and Design Applying UML and Patterns An Introduction to Object-oriented Analysis and Design and Iterative.
Introduction to Interaction Diagrams Used to illustrate the dynamic behaviour of a community of objects that collaborate by passing messages in order to.
System Sequence Diagrams. Recap When to create SSD? How to identify classes/instances? Use case descriptions UML notations for SSD.
1 On to Object Design Chapter 14 Applying UML and Patterns.
10/16/2015CPSC , CPSC , Lecture 61 Software Engineering, CPSC , CPSC , Lecture 6.
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.
BTS430 Systems Analysis and Design using UML Interaction Diagrams.
Copyright © Hsiao-Lan Wei All Rights Reserved Design Model Interaction diagram.
Chapter 4: UML Interaction Diagrams. Objective Provide a reference for frequently used UML interaction diagram notation- sequence and communication diagrams.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 02. Objects,
Design Class Diagrams (DCDs)
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.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Interaction and Communication Diagrams Patrick Bailey Keith Vander Linden Calvin College.
SWE © Solomon Seifu Models Communication Use caseActivity ObjectDeployment StateSequence Component Class Package Behavior diagram InteractionTiming.
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.
Interaction Diagram Notation
Object-Oriented Analysis and Design Feb 11, 2009.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour UML Sequence Diagram.
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Object Oriented Analysis and Design Sequence Diagrams.
1 On To Object Design Chapter 14 Applying UML and Patterns -Craig Larman.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
Collaboration diagrams. Purpose A collaboration diagram is an alternate way to show a scenario. A collaboration diagram shows the objects and relationships.
Com S 362: Object-Oriented Analysis and Design From Design To Code.
Chapter 16 UML Class Diagrams.
Chapter 3: Introducing the UML
Communication Diagrams Lecture 8. Introduction  Interaction Diagrams are used to model system dynamics  How do objects change state?  How do objects.
 The Sequence Diagram models the collaboration of objects based on a time sequence.  It shows how the objects interact with others in a particular scenario.
Dr. Kivanc DincerCS319 Week 6 - Oct.17,20051 Chapter 14 Onto Object Design Objectives Understand dynamic and static object design modeling. Try agile modeling,
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.
Collaboration Diagrams
UML Interaction Diagrams
UML SEQUENCE DIAGRAM.
Chapter 11: Collaboration Diagram - PART1
Sequence Diagram.
Requirements To Design In This Iteration
System Sequence Diagrams
Communication Diagrams
Interaction diagrams.
Sequence Diagrams Getting the Message.
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
Interaction Diagrams A Lot of UML!
Chapter 9: Sequence Diagrams Chapter 5 in Software Engineering Book
UML Interaction Diagrams
Presentation transcript:

Starting Object Design Chapter 14 Starting Object Design

Spend time on dynamic models They are the key tool for building good static models

One Object Design Technique: Class Responsibility Collaboration (CRC) cards

CRC Card examples

Dynamic modeling of object: Interaction Diagrams Chapter 15 Dynamic modeling of object: Interaction Diagrams

UML Interaction Diagrams Two variants Sequence diagrams Communication diagrams

Example: Sequence Diagram

What does this represent in code? public class A { private B myB = new B(); public void doOne() { myB.doTwo(); myB.doThree(); }

Example: Collaboration Diagram

Strengths and Weaknesses of Sequence and Collaboration Diagrams

Example Sequence Diagram public class Sale { private Payment payment; public void makePayment(Money cashTendered) { payment = new Payment(cashTendered); // ... }

Example collaboration diagram public class Sale { private Payment payment; public void makePayment(Money cashTendered) { payment = new Payment(cashTendered); // ... }

Lifeline boxes

Used if we want only ONE instance of a class instantiated The Singleton Pattern Used if we want only ONE instance of a class instantiated Examples: Database, log We’ll learn how to accomplish this in Java later

Lifelines, messages, “found” or “starting” messages

Illustrating Replies or Return Values Two alternatives Using the message syntax returnVar = message(parameter) Use a reply or return message at the end of an activation bar

Messages to “self” or “this”

Instance Creation

Object Destruction (Object no longer used or usable) Object explicitly destroyed or no longer usable (reachable) Example: No variable refers to object any longer Marked for garbage collection

Looping notation

A conditional message

UML Version 1 notation for conditional messages

Mutually exclusive conditional messages

Iteration over a collection: Explicit notation Selector expression

Iteration over a collection: Implicit notation

Nested frames

How to relate interaction diagrams (hierarchical notation)

Invoking static or class methods public class Foo { public void doX() { // Static method call on class Calendar Locale[] locales = Calendar.getAvailableLocales() // ... }

Polymorphic Messages and Cases

Polymorphic Messages and Cases

Asynchronous vs. Synchronous Calls Asynchronous message: Does not wait for a response “It doesn’t block” Used in multi-threaded environments New threads can be created and initiated Example: In Java Thread.start Runnable.run initiate execution of a new thread

Asynchronous vs. Synchronous Calls Active object: Each instance runs on and controls its own thread of execution Example: Clock

Collaboration Diagram Notation Link: Connection path between two objects Indicates a form of navigation or visibility between the objects Formally: An instance of an association There can be only one link between two objects Multiple messages in both directions flow along this link

Communication Diagram Notation

Messages to “self” or “this”

Instance creation in communication diagrams

Sequence Numbering Nested message

Sequence Numbering

Sequence Numbering

Conditional messages

Mutually exclusive conditional messages

Iteration in communication diagrams

Iteration over a collection

Static method invocation (message to a class)

Modeling polymorphic cases in communication diagrams

Asynchronous messages in communication diagrams