Executable UML The Models are the Code - Executable UML Lecture 9 - Communication and Relationship Dynamics Paul Krause.

Slides:



Advertisements
Similar presentations
Creating and Submitting Orders Remy Order Management System.
Advertisements

Operating Systems Lecture 7.
Outlook 2010 Quick Guide Table of Contents: Overview of client, Sending/Receiving , Using the address book………..……… Sent Items……………………………………………………………………………………………..…..8.
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
ZEIT2301 Design of Information Systems Behavioural Design: State Machines School of Engineering and Information Technology Dr Kathryn Merrick.
Chapter 22 UML Tooks and UML as Blueprint Model-Driven Architecture (MDA) Object-Constraint Language (OCL)
1 Chapter 4 Dynamic Modeling and Analysis (Part I) Object-Oriented Technology From Diagram to Code with Visual Paradigm for UML Curtis H.K. Tsang, Clarence.
Sequence Diagram Objects are represented horizontally across the top of the diagram Each object has a lifeline some exist before and/or after some are.
Slide 1 Systems Analysis & Design CS183 Spring Semester Dr. Jonathan Y. Clark Course Website:
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
Essentials of interaction diagrams Lecture 23 & 24.
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Federal Acquisition Service U.S. General Services Administration
Advanced Behavioral Modeling
Modeling Dynamic Behavior: Sequence and Collaboration Diagrams.
Slide 1 Chapter 8 Behavioral Modeling. Slide 2 Key Ideas Behavioral models describe the internal dynamic aspects of an information system that supports.
SE-565 Software System Requirements More UML Diagrams.
Blaha and Rumbaugh Sections 7.2 and 8.2
Radiant-Seacom Repairs
“If you build it, they will come.”. Virtual Business  There is much more that goes into a virtual business than just building the web site.  You will.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
State and Sequence Diagrams Modelling dynamic information So far we have seen: Use Case Diagrams – requirements capture, interface.
1 1.
Department of Information Technology e-Michigan Web Development 0 HTML Form Creation in the Vignette Content Management Application.
UML Collaboration Diagram. Recap System Sequence Diagrams (SSD) UML for SSD Examples.
Copyright CovalentWorks Training Guide for Invoices MYB2B Powered by CovalentWorks.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Software Engineering 1 Object-oriented Analysis and Design Chap 30 Relating Use Cases.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 8: Modelling Interactions and Behaviour.
Executable UML The Models are the Code - Executable UML Lecture 8 - Interactions and Operations Paul Krause.
1 Object-Oriented Modeling Using UML (2) CS 3331 Fall 2009.
Introduction to Sequence Diagrams
Executable UML The Models are the Code - Executable UML Lecture 3 - Modelling with Domains and Classes Paul Krause.
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.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
1. To start the process, Warehouse Stationery (WSL) will invite you to use The Warehouse Group Supplier Electronic Portal and will send you the link to.
Setting Up Alerts and Dashboard Links. When you first start using the Active Orders system, you will need to establish the settings for two types.
Behavioral Modeling Chapter 8.
Checkout Options Tour Unlock the “POWER” of V7.2 To navigate through this Tutorial use your mouse, or Page Up or Down Key Introduction Slide One.
7 Systems Analysis and Design in a Changing World, Fifth Edition.
Information Systems Engineering Interaction Diagrams: Sequence Diagram Collbortion Diagram.
© 2008 Prentice Hall, Ovidiu Noran Lecture 7b 1 Modelling OO Logic Requirements: Sequence Diagrams and Activity Diagrams (Textbook Chapter 8, Appendix)
Object-Oriented Analysis and Design 1 Mira Balaban & Arnon Sturm Object-Oriented Analysis and Design Session 3a: Behavioral Modeling - Interactions.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-4 Process Communication Department of Computer Science and Software.
CSCI-383 Object-Oriented Programming & Design Lecture 12.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
Phase 6 Start: Saturday14 April End: Saturday 21 April
Dynamic Models Sequence Diagrams Collaboration Diagrams Activity Diagrams.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
Internal and Confidential Cognos CoE COGNOS 8 – Event Studio.
Chapter 8 Supporting the Sales Process with SAP Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall 8-1.
Observations so far…. In general… There are two ways to design a software system –Centralized control One “driver” function that contains the entire algorithm.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
Sequence Diagram SAD ::: Fall 2015 Sabbir Muhammad Saleh.
McGraw-Hill/Irwin© 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 17 Object-Oriented Design and Modeling Using the UML.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Wixom, and David Tegarden Chapter 8: Behavioral Modeling.
Accuship Desktop Shipping. AGENDA I.Single Shipment Creation II.Single Shipment Cancellation III.Multi Piece Shipment Creation IV.Group Shipment Creation.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
Lecturer: Eng. Mohamed Adam Isak PH.D Researcher in CS M.Sc. and B.Sc. of Information Technology Engineering, Lecturer in University of Somalia and Mogadishu.
Chapter 7 Behavioral Modeling Brandon A. Jones Stand and Deliver ITEC March 6, 2011.
Work In Progress Presentation. Orders Alex Thornton.
Partner Managed Inventory (PMI) Process
Chapter 11: Collaboration Diagram - PART1
Prepared By Sidra Noureen
Affiliate Advantage How to
How to Modify a Requisition Using Owl Link
Inter Process Communication (IPC)
Presentation transcript:

Executable UML The Models are the Code - Executable UML Lecture 9 - Communication and Relationship Dynamics Paul Krause

Executable UML Lecture 9 - Communication and Relationship Dynamics v Parameter passing using signals v Synchronous creation and deletion of objects v Class-based state machines

Executable UML Signals v The dynamics of a domain are established by the exchange of signals between state machine instances v Signals may contain data v The data in a signal may be used by the entry actions in the recipient state machine v Signalling is asynchronous  the sending machine carries on with its business  the receiving state machine may execute a transition, and may choose to send another signal, but it does not “return” to the sender.

Executable UML Signal exchange between objects Shipment shipmentID trackingNumber recipient … OrderProductSelectionBook R9 R6 R is included in includes 1..* 0..1 is sent to customer as 1 delivers contents of 1..* contains customer selections of 1..* contains customer selections of 0..* is purchased on

Executable UML Signal exchange between objects Delivered to Customer entry/ self.timeDelivered = rcvd_evt.reportedDeliveryTime // signal that the order has been delivered select one order related by self -> Order[R6] generate orderDelivered to order Being Packed and Shipped entry/ // Notify customer that the charge // was approved and the order will // be shipped // create a Shipment for the order Delivered to Customer entry/ // notify the Customer that we think // the order has been delivered select one customer related by self ->Customer[R5] generate orderReportedDelivered( customer customer. ) to EE_Online_Customer orderDelivered // signal that the order has been delivered select one order related by self -> Order[R6] generate orderDelivered to order Shipment state machine Order state machine // notify the Customer that we think // the order has been delivered select one customer related by self ->Customer[R5] generate orderReportedDelivered( customer customer. ) to EE_Online_Customer orderDelivered

Executable UML Event parameters v We may wish to pass items of data as parameters to events v The collection of event parameters can be viewed as an object v By convention, this object is denoted: rcvd_evt v The entry actions may then access the values of the parameters by referring to rcvd_evt v Rule:  all events that cause a transition into a particular state must carry the same parameters

Executable UML Passing event parameters Establishing Customer and Verifying Payment entry/ // Create a customer if one does not already // exist with the given address select any customer from instances of Customer where selected. == rcvd.evt.customer ; if empty customer create object instance customer of Customer; customer. = rcvd_evt.customer ; end if; // use the name, address etc to update the customer // whether new or existing customer.name = rcvd_evt.customerName; customer.shippingAddress = rcvd_evt.shippingAddress; customer.phone = rcvd_evt.customerPhone; // Link the order to the customer relate self to customer across R5; checkOut(accountNumber, billingAddress, cardExpirationDate, cardHolderName, customer , customerName, customerPhone, shippingAddress)

Executable UML Passing event parameters Establishing Customer and Verifying Payment entry/ // Create a customer if one does not already // exist with the given address select any customer from instances of Customer where selected. == rcvd.evt.customer ; if empty customer create object instance customer of Customer; customer. = rcvd_evt.customer ; end if; // use the name, address etc to update the customer // whether new or existing customer.name = rcvd_evt.customerName; customer.shippingAddress = rcvd_evt.shippingAddress; customer.phone = rcvd_evt.customerPhone; // Link the order to the customer relate self to customer across R5; checkOut(accountNumber, billingAddress, cardExpirationDate, cardHolderName, customer , customerName, customerPhone, shippingAddress) // Create a customer if one does not already // exist with the given address select any customer from instances of Customer where selected. == rcvd.evt.customer ; if empty customer create object instance customer of Customer; customer. = rcvd_evt.customer ; end if;

Executable UML Passing event parameters Establishing Customer and Verifying Payment entry/ // Create a customer if one does not already // exist with the given address select any customer from instances of Customer where selected. == rcvd.evt.customer ; if empty customer create object instance customer of Customer; customer. = rcvd_evt.customer ; end if; // use the name, address etc to update the customer // whether new or existing customer.name = rcvd_evt.customerName; customer.shippingAddress = rcvd_evt.shippingAddress; customer.phone = rcvd_evt.customerPhone; // Link the order to the customer relate self to customer across R5; checkOut(accountNumber, billingAddress, cardExpirationDate, cardHolderName, customer , customerName, customerPhone, shippingAddress) // use the name, address etc to update the customer // whether new or existing customer.name = rcvd_evt.customerName; customer.shippingAddress = rcvd_evt.shippingAddress; customer.phone = rcvd_evt.customerPhone;

Executable UML Passing event parameters Establishing Customer and Verifying Payment entry/ // Create a customer if one does not already // exist with the given address select any customer from instances of Customer where selected. == rcvd.evt.customer ; if empty customer create object instance customer of Customer; customer. = rcvd_evt.customer ; end if; // use the name, address etc to update the customer // whether new or existing customer.name = rcvd_evt.customerName; customer.shippingAddress = rcvd_evt.shippingAddress; customer.phone = rcvd_evt.customerPhone; // Link the order to the customer relate self to customer across R5; checkOut(accountNumber, billingAddress, cardExpirationDate, cardHolderName, customer , customerName, customerPhone, shippingAddress) // Link the order to the customer relate self to customer across R5;

Executable UML Signals and events v A signal is an asynchronous message v An “event” is the receipt of a signal by some state machine  strictly, a signal event v When a signal is generated, its parameters are instantiated using name-value pairs v e.g.  generate addSelection( productID: rcvd_evt.productID, quantity: rcvd_evt.quantity) to order;

Executable UML Signals to self New Order entry/ // Add the first selection to the order generate addSelection( productID: rcvd_evt.productID, quantity: rcvd_evt.quantity) to self; Adding Selection to Order entry/ // Add the (next) selection to the order … addSelection(productID, quantity) generated and sent to self received and acted on. Signals from self are always acted on before any other outstanding signals

Executable UML Creation and deletion of objects v Actions can synchronously create or delete instances of objects without state machines within a procedure v Instances with state machines can be created or deleted asynchronously by sending them signals v Synchronous creation and deletion of objects with state machines is also possible  see Mellor and Balcer section

Executable UML Synchronous creation and deletion of objects Order state machine Adding Selection to Order entry/ // Add the (next) selection to the order create object instance newSelection of ProductSelection; select any book from instances of Product where selected.ProductID == rcvd_evt.bookNumber; relate book to self across R4 using newSelection; … addSelection (productID, quantity) addSelection (productID, quantity) cancel checkOut(…)

Executable UML Synchronous creation and deletion of objects Order state machine Adding Selection to Order entry/ // Add the (next) selection to the order create object instance newSelection of ProductSelection; select any book from instances of Product where selected.ProductID == rcvd_evt.bookNumber; relate book to self across R4 using newSelection; … addSelection (productID, quantity) addSelection (productID, quantity) cancel checkOut(…)

Executable UML Synchronous creation and deletion of objects Order state machine Adding Selection to Order entry/ // Add the (next) selection to the order create object instance newSelection of ProductSelection; select any book from instances of Product where selected.ProductID == rcvd_evt.bookNumber; relate book to self across R4 using newSelection; … addSelection (productID, quantity) addSelection (productID, quantity) cancel checkOut(…)

Executable UML Synchronous creation and deletion of objects Order state machine Adding Selection to Order entry/ // Add the (next) selection to the order create object instance newSelection of ProductSelection; select any book from instances of Product where selected.ProductID == rcvd_evt.bookNumber; relate book to self across R4 using newSelection; newSelection.quantity = rcvd_evt.quantity; addSelection (productID, quantity) addSelection (productID, quantity) cancel checkOut(…)

Executable UML Synchronous creation and deletion of objects Cancelling Entire Order entry/ // Delete all the selections of the Order select many selections related by self -> ProductSelection[R4]; for each selection in selections select one product related by selection ->Product[R4]; unrelate self from product across R4 using selection; end for; cancel destroying the association will destroy the respective instance of the association class

Executable UML Competition in associations Shipment shipmentID trackingNumber recipient … ShippingClerk awaitingAssignment 0..1 is currently packing 0..1 is currently being packed by R23

Executable UML (Partial) State machine for shipping clerk 1: Clerk Idle entry/ select one currentShipment related by self -> Shipment[R23]; … 2; Selecting Books entry/ … shipmentReady

Executable UML Two idle clerks… A: Shipping clerkB: Shipping clerk:Shipment select shipment both clerks try to grab the same shipment

Executable UML Use of an assigner state machine v Usually this will be a class-based state machine v Has only one instance v The assigner is a single point of control for resolving resource contention v This is in addition to any object-based state machine

Executable UML Shipping Clerk Assigner 1: Waiting for Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; if not empty readyShipment generate shipmentReadyToPack to self; end if; 2: Waiting for a Free Clerk entry/ select any freeClerk from instances of ShippingClerk where selected.idle; if not empty freeClerk generate clerkFree to self; end if; 3: Assigning Clerk to Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; select any freeClerk from instances of ShippingClerk where selected.idle; relate freeClerk to readyShipment across R23; readyShipment.waitingToBePacked = false; freeClerk.idle = false; generate clerkAssigned to freeClerk; generate clerkAssignedToShipment to self; shipmentReadyToPack clerkFree clerkAssignedToShipment

Executable UML Shipping Clerk Assigner 2: Waiting for a Free Clerk entry/ select any freeClerk from instances of ShippingClerk where selected.idle; if not empty freeClerk generate clerkFree to self; end if; 3: Assigning Clerk to Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; select any freeClerk from instances of ShippingClerk where selected.idle; relate freeClerk to readyShipment across R23; readyShipment.waitingToBePacked = false; freeClerk.idle = false; generate clerkAssigned to freeClerk; generate clerkAssignedToShipment to self; shipmentReadyToPack clerkFree clerkAssignedToShipment 1: Waiting for Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; if not empty readyShipment generate shipmentReadyToPack to self; end if;

Executable UML Shipping Clerk Assigner 1: Waiting for Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; if not empty readyShipment generate shipmentReadyToPack to self; end if; 3: Assigning Clerk to Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; select any freeClerk from instances of ShippingClerk where selected.idle; relate freeClerk to readyShipment across R23; readyShipment.waitingToBePacked = false; freeClerk.idle = false; generate clerkAssigned to freeClerk; generate clerkAssignedToShipment to self; shipmentReadyToPack clerkFree clerkAssignedToShipment 2: Waiting for a Free Clerk entry/ select any freeClerk from instances of ShippingClerk where selected.idle; if not empty freeClerk generate clerkFree to self; end if;

Executable UML Shipping Clerk Assigner 1: Waiting for Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; if not empty readyShipment generate shipmentReadyToPack to self; end if; 2: Waiting for a Free Clerk entry/ select any freeClerk from instances of ShippingClerk where selected.idle; if not empty freeClerk generate clerkFree to self; end if; shipmentReadyToPack clerkFree clerkAssignedToShipment 3: Assigning Clerk to Shipment entry/ select any readyShipment from instances of Shipment where selected.waitingToBePacked; select any freeClerk from instances of ShippingClerk where selected.idle; relate freeClerk to readyShipment across R23; readyShipment.waitingToBePacked = false; freeClerk.idle = false; generate clerkAssigned to freeClerk; generate clerkAssignedToShipment to self;

Executable UML Summary v Parameters can be passed between state machines using signals v We have explored some aspects of  Synchronous creation and deletion of objects  Asynchronous creation and deletion of objects v We have also seen how class-based state machines can be used to handle resource contention v See Chapters of Mellor and Balcer