© 2012 Metamaxim Ltd Modelling Choreography Ashley McNeile 1 st February 2012.

Slides:



Advertisements
Similar presentations
The StAir Design will instruct students with Special Needs what a checking account is and how to open their own checking account.
Advertisements

A business makes payments for what it buys, In return it receives payments for goods it sells or services it provides.
Use Case & Use Case Diagram
Legalmaster and Retainers Copyright 2008 Computer Software for Professionals, Inc.
Visual Basic: An Object Oriented Approach 2 – Designing Software Systems.
Robert B. Jackson Brigham Young University John W. Satzinger
UML and Systems Analysis MIS3502: Application Integration and Evaluation David Schuff
CPSC 333: Foundations of Software EngineeringJ. Denzinger Small Test: Bank account manager System has to run on an automated teller machine. User must.
Lecture 8 Electronic Commerce Modelling Techniques
Sequence Diagrams. Introduction A Sequence diagram depicts the sequence of actions that occur in a system. The invocation of methods in each object, and.
Bank On It.
Payments Banking & Finance. Bellringer Online Chapter 9 Pretest
Chapter 5 Expenditure Cycle Applications. Expenditure Documents i.Purchase Requisitions ii.Purchase Orders iii.Receiving Report iv.Voucher Systems v.Invoice.
By S.K Chik. Introduction At each given date, our banker should send us a statement which shows the details of our bank transactions during a particular.
Interaction Diagrams Activity Diagram State Machine Diagram
Metamaxim Ltd. Ashley McNeile Metamaxim Ltd. University of Leicester June 2005.
Ordering and Consistent Cuts Presented By Biswanath Panda.
January Ron McFadyen1 Ch 9. Use-case model: drawing System Sequence Diagrams Elaboration Iteration 1: a simple cash-only success scenario of.
Ims5024 Week 71 IMS 5024 Object orientation (2). Ims5024 Week 72 Content Group assignment Use-cases State transition diagrams Place in ISD Evaluation.
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.
Use Case Modeling. Use case diagram For each use case we develop  Object class diagram (with attributes only)  System sequence diagram (analysis) 
Bank Reconciliation Objective 4.02D Students will understand and complete the bank reconciliation process.
FINANCE Chapter 9 Checking Accounts and Other Banking Services.
Banking: Checking Account What is a Checking Account? An account where money is deposited and kept for day-to-day expenses Also called demand deposit.
Chapter © 2010 South-Western, Cengage Learning Checking Accounts and Banking Services Banking Services and Fees 9.
1 CSC103: Introduction to Computer and Programming Lecture No 13.
Use Cases 2 ENGR ♯10 Peter Andreae
Exercise Develop a context Diagram for a small bank for “Loan Granting” process Identify EXTERNAL entities Develop a Context diagram.
Software Waterfall Life Cycle Requirements Construction Design Testing Delivery and Installation Operations and Maintenance Concept Exploration Prototype.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 25. Review Design Level Class Diagram Identifying classes/Operations/Attributes Associations – Simple associations.
Kardashian Kard “Take Us With You Everywhere”. What is It? Credit Card/ Debit Card Pre-Paid Both Online (Mobile) and Offline Payments.
Faculty of Computer & Information Software Engineering Third year
Chapter 3, Section 3 ELECTRONIC BANKING.
1 The CeNTIE project is supported by the Australian Government through the Advanced Networks Program of the Department of Communications, Information Technology.
Copyright 2002 Prentice-Hall, Inc. Chapter 2 Object-Oriented Analysis and Design Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey.
SFWR ENG 3KO4 Software Development for Computer/Electrical Engineering Fall 2009 Instructor: Dr. Kamran Sartipi Software Requirement Specification (SRS)
Year 9 BUSINESS BUSINESS DOCUMENTS. FINANCIAL DOCUMENTS The documentation prepared when conducting business includes: Purchase orders Tax invoices Delivery.
1SSPD Jackson System Development From Models to Networks.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
1 A Student Guide to Object- Oriented Development Chapter 7 State Diagrams.
“Check” Out These Terms!. Overdrawn – The amount by which withdrawals exceed deposits Overdraft Protection – the bank will cover the check or pay the.
1 Capturing Requirements As Use Cases To be discussed –Artifacts created in the requirements workflow –Workers participating in the requirements workflow.
1 Kyung Hee University Statecharts Spring Kyung Hee University Specifying Objects’ Behaviour  Interaction diagrams show message-passing behaviour.
Cuallet step by step guide. Step 1 From the Cuallet home page, click the “Sign Up Now” button. New user / Register.
1 Graph Coverage (6). Reading Assignment P. Ammann and J. Offutt “Introduction to Software Testing” ◦ Section
UML’s StateChart FSM, EFSM in UML Concurrent states Tool support.
CS212: Object Oriented Analysis and Design Lecture 34: UML Activity and Collaboration diagram.
DOE OPSR Program Payroll Training. Payroll Cards: 101 All Participants will have payments sent to a personalized Payroll Card ◦Name ◦Visa Logo ◦PIN Benefits.
16/11/ Web Services Choreography Requirements Presenter: Emilia Cimpian, NUIG-DERI, 07April W3C Working Draft.
© 2003 SOUTH-WESTERN PUBLISHINGCHAPTER 23Slide 1 CHAPTER 23 BANKING AND CREDIT 23.1Financial Institutions 23.2Checking Accounts 23.3Credit and Its Use.
BANKING PRODUCTS. CHECKING Non interest bearing accounts FREE CHECKING Direct Deposit – for payroll; convenient for the customer Auto Pay – for utility.
Cash Book. A few weeks ago we looked at recording invoices and credit notes in the Sales/Sales Returns Day Book and the Purchases/Purchase Returns Day.
1 LAB What is Collaboration diagram? 4 Collaboration diagrams illustrate the interaction between the objects, using static spatial structure. 4.
Financial Algebra © 2011 Cengage Learning. All Rights Reserved. Slide CHECKING ACCOUNTS Understand how checking accounts work. Complete a check register.
HighImpactSoft 2010 Organizing a Better Future. Agenda Specify Goals ScopeDefinitions Process Model Preliminary Requirements Issues and solutions TraceabilityPrototype.
4.02 E STUDENTS WILL UNDERSTAND THE PURPOSES OF SPECIAL CHECKS STUDENTS WILL UNDERSTAND STOP PAYMENT ORDERS AND VOID CHECKS. Other Forms of Payment.
Activity diagrams Practice 7. Task 1  The first action in the activity is the adding the item to the order. If the order if formed (“ready”), then it.
Sequence Diagrams.
Dynamic Modeling of Banking System Case Study - I
Discrete Manufacturing SIG Cost Sub-Committee
Sequence Diagrams.
UML’s StateChart FSM, EFSM in UML Concurrent states Tool support.
Object Oriented System Design COS 50-3
Object Oriented Design Model
SAD ::: Spring 2018 Sabbir Muhammad Saleh
Using Use Case Diagrams
Seminar 9 BPMN Diagrams.
Accounting 1 Review #2 State Test.
Exercise Develop a context Diagram for a small bank for “Loan Granting” process Identify EXTERNAL entities Develop a Context diagram.
Presentation transcript:

© 2012 Metamaxim Ltd Modelling Choreography Ashley McNeile 1 st February 2012

© 2012 Metamaxim Ltd Background

© 2012 Metamaxim Ltd Agenda A little background Introduction to Protocol Modelling – A way of modelling rich interaction between state, data, and behaviour – Concerned with behaviour description using composition (composition of partial descriptions) Application to Choreography – Multiparty asynchronous collaborations – Reasoning a realizability

© 2012 Metamaxim Ltd “Pure” Process Algebra Closed Open B0 B1 B2 B-1 B-2 D2 D1 W2 W1 Close Ability to ExpressAbility to Reason Bank Account Balance values in range -2 to +2 Deposit events D1 and D2 Withdraw events W1 and W2 Close only possible when “in credit” ACCOUNT = Open  B0 B0 = D1  B1 | D2  B2 | W1  B-1 | W2  B-2 | Close  Closed B1 = D1  B2 | W1  B0 | W2  B-1 | Close  Closed B2 = W1  B1 | W2  B0 | Close  Closed B-1 = D1  B0 | D2  B1 | W1  B-2 B-2 = D1  B-1 | D2  B0

© 2012 Metamaxim Ltd Composition Tony Hoare Deterministic Choice P  Q Choice determined by the environment on the basis of the first action. Nondeterministic Choice P ∏ Q The environment has no control over the choice. Interleaving P ||| Q Completely independent concurrent activity. Interface Parallel P || Q Concurrent activity that requires synchronization between the component processes.

© 2012 Metamaxim Ltd Eclipsed by “OOP mania” in 1980s and 1990s. Early ideas in OO (1980s) Domain Object Behaviour JSD (Jackson System Development) Shlaer/Mellor (Recursive Design) M.A. Jackson Bank Account Transaction In UseOpenClose DepositWithdraw * oo Diagrams used to describe and formalise “object life-cycles.” Objects own data (like OO) balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Composition not emphasized

© 2012 Metamaxim Ltd Protocol Modelling

© 2012 Metamaxim Ltd Protocol Modelling Open Active Closed Close Deposit Withdraw balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Account Machine 1 Open Un- frozen Withdraw Account Machine 2 Frozen Release Freeze Release Close In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn

© 2012 Metamaxim Ltd Protocol Modelling Open Active Closed Close Deposit Withdraw balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Account Machine 1 Open Un- frozen Withdraw Account Machine 2 Frozen Release Freeze Release Close In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn Open Active Closed Close Deposit Withdraw balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Account Machine 1 Open Un- frozen Withdraw Account Machine 2 Frozen Release Freeze Release Close In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn Account = Account Machine 1 || Account Machine 2 ||Account Machine 3

© 2012 Metamaxim Ltd Protocol Modelling Active Closed Account Machine 1 Un- frozen Account Machine 2 Frozen In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn Open Release Close balance = ?? Close Deposit Withdraw Open Withdraw Release Freeze balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Release Close balance = 0 Close Deposit Withdraw Open Withdraw Release Freeze

© 2012 Metamaxim Ltd Protocol Modelling Withdraw 20 Active Closed Account Machine 1 Un- frozen Account Machine 2 Frozen In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Release Close balance = 0 Close Deposit Withdraw Open Withdraw Release Freeze Release Close balance = -20 Close Deposit Withdraw Open Withdraw Release Freeze

© 2012 Metamaxim Ltd Protocol Modelling Close Active Closed Account Machine 1 Un- frozen Account Machine 2 Frozen In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Release Close balance = -20 Close Deposit Withdraw Open Withdraw Release Freeze X

© 2012 Metamaxim Ltd Protocol Modelling Freeze Active Closed Account Machine 1 Un- frozen Account Machine 2 Frozen In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Release Close balance = -20 Close Deposit Withdraw Open Withdraw Release Freeze Release Close balance = -20 Close Deposit Withdraw Open Withdraw Release Freeze

© 2012 Metamaxim Ltd Protocol Modelling What Now? Active Closed Account Machine 1 Un- frozen Account Machine 2 Frozen In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Release Close balance = -20 Close Deposit Withdraw Open Withdraw Release Freeze

© 2012 Metamaxim Ltd Protocol Modelling Open Active Closed Close Deposit Withdraw balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Account Machine 1 Open Un- frozen Withdraw Account Machine 2 Frozen Release Freeze Release Close In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn Topological (State is driven by transitions) Non- Topological (State is calculated) Open Active Closed Close Deposit Withdraw balance := balance + Deposit.amount; balance := balance - Withdraw.amount; balance := 0; Account Machine 1 Open Un- frozen Withdraw Account Machine 2 Frozen Release Freeze Release Close In Credit State Function: if (balance < 0) return “Overdrawn”; else return “In Credit”; Account Machine 3 Over- drawn

© 2012 Metamaxim Ltd Construction of AM1||AM2 d1 Open Active Closed Close Deposit Withdraw Open Un- frozen Withdraw Frozen Release Freeze d2 Deposit Release Freeze Close Deposit Close Deposit Withdraw Open Release Freeze Release Freeze Closed, Frozen Closed, Un-frozen Active, Un-frozen Active, Frozen d1, d2 AM2 AM1||AM2 Closed, d2 Active, d2 d1, Frozen d1, Un-frozen AM1

© 2012 Metamaxim Ltd Choreography

© 2012 Metamaxim Ltd Dancer 4 Dance Choreography Dancer 1 Dancer 3 Dancer 2

© 2012 Metamaxim Ltd Scenario Messages are FIFO between each pair The network does not block How do we ensure that the collaboration “works”?

© 2012 Metamaxim Ltd Step 1: Design the Choreography PQ R m1, m6 m2 m3, m7, m8 m5 m4 P>Q:m1 Q>P:m2 Q>R:m3 P>R:m5 R>P:m4 P>Q:m6 Q>R:m7 Q>R:m8 The labels on transitions show message exchanges. P>Q:m1 denotes P sending a message of type m1 to Q.

© 2012 Metamaxim Ltd Q>R:m3 Q>R:m7 Q>R:m8 P>Q:m1 Q>P:m2 Step 2: Project to Participants P P>Q:m1 Q>P:m2 P>R:m5 R>P:m4 P>Q:m6 !>Q:m1 ?<R:m4 !>Q:m6 !>R:m5 ?<Q:m2

© 2012 Metamaxim Ltd P Step 2: Project to Participants !>Q:m1 ?<R:m4 !>Q:m6 !>R:m5 ?<Q:m2 !>Q:m1 ?<R:m4 !>Q:m6 !>R:m5 ?<Q:m2 R ?<Q:m3 !>P:m4 ?<P:m5 ?<Q:m7 ?<Q:m8 Q ?<P:m1 !>P:m2 !>R:m3 ?<P:m6 !>R:m7 !>R:m8

© 2012 Metamaxim Ltd P Step 3: “Enact” !>Q:m1 ?<R:m4 !>Q:m6 !>R:m5 ?<Q:m2 R ?<Q:m3 !>P:m4 ?<P:m5 ?<Q:m7 ?<Q:m8 Q ?<P:m1 !>P:m2 !>R:m3 ?<P:m6 !>R:m6 !>R:m7 Will the emergent behaviour of the collaboration follow the original choreography? Imagine a “global clock” On each tick, one thing happens: one send or one receive Does the ordering of sends match a trace of the choreography?

© 2012 Metamaxim Ltd Some Examples P Q P>Q:m1 Q>P:m2 m1 m2 P Q m1 m2 P>Q:m1 Q>P:m2 No! Yes! P Q m1 m2 P>Q:m1Q>P:m2 Yes!

© 2012 Metamaxim Ltd Some Examples P>Q:m1Q>R:m2 P>R:m3 P Q m1 m2 R m3 No! P>Q:m1Q>P:m3 R>Q:m2Q>P:m3 P Q m1 m2 R m3 Yes!

© 2012 Metamaxim Ltd The Rules (Simplified!) Within a single choreography machine: 1.Only one sender from given state of the choreography 2.No Send must take place from an ambiguous state - Q - Q P R P>Q:m1 Q>P:m2 Q>R:m3 P>R:m5 R>P:m4 P>Q:m6Q>R:m7 Q>R:m8 P !>Q:m1 ? <R:m4 !>Q:m6 !>R:m5 ? <Q:m2 ?<P:m1 !>P:m2 !>R:m3 ? <P:m6 !>R:m6 !>R:m7 ? <Q:m3 !>P:m4 ?<P:m5 ? <Q:m7 ? <Q:m8

© 2012 Metamaxim Ltd Scenario Place Order Request Cancel Request Amend Accept Order Accept Amend Accept Cancel Invoice Request Credit Check Request Deposit Payment Receipt Pay Deposit Pay Order Credit OK Deposit Paid Request Delivery Request Delivery Date Confirm Delivery Date SUPPLIERCUSTOMER DELIVERY CO BANK C S B DC S B D

© 2012 Metamaxim Ltd C S B D Choreography 1 D] Cust > Supp: Request Cancel Supp > Cust: Accept Cancel Supp > Cust: Reject Cancel Cust > Supp: Place Order Supp > Cust: Accept Order Cust > Supp: Request Amend Supp > Cust: Accept Amend Supp > Cust: Reject Amend Supp > Cust: Reject Order

© 2012 Metamaxim Ltd C S B D Choreography 2 D] Supp > Cust: Accept Order Supp > Cust: Invoice Cust > Bank: Pay Order Bank > Cust: Payment Receipt Supp > Cust: Accept Cancel Supp > Cust: Accept Amend Cust > Supp: Place Order Cust > Bank: Pay Deposit Supp > Bank: Request Credit Check Bank > Supp: Credit OK Bank > Cust: Request Deposit Bank > Supp: Deposit Paid

© 2012 Metamaxim Ltd C S B D Choreography 3 D] Supp > Cust: Accept Order Supp > Del: Request Delivery Del > Cust: Request Delivery Date Cust > Del: Confirm Delivery Date Del > Supp: Confirm Delivery Date Supp > Cust: Invoice Supp > Cust: Accept Cancel Supp > Cust: Accept Amend

© 2012 Metamaxim Ltd Composition D] Supp > Cust: Accept Order Supp > Del: Request Delivery Del > Cust: Request Delivery Date Cust > Del: Confirm Delivery Date Del > Supp: Confirm Delivery Date Supp > Cust: Invoice Supp > Cust: Accept Cancel Supp > Cust: Accept Amend D] Cust > Supp: Request Cancel Supp > Cust: Accept Cancel Supp > Cust: Reject Cancel Cust > Supp: Place Order Supp > Cust: Accept Order Cust > Supp: Request Amend Supp > Cust: Accept Amend Supp > Cust: Reject Amend Supp > Cust: Reject Order D] Supp > Cust: Accept Order Supp > Cust: Invoice Cust > Bank: Pay Order Bank > Cust: Payment Receipt Supp > Cust: Accept Cancel Supp > Cust: Accept Amend Cust > Supp: Place Order Cust > Bank: Pay Deposit Supp > Bank: Request Credit Check Bank > Supp: Credit OK Bank > Cust: Request Deposit Bank > Supp: Deposit Paid C S B D S S S C B S S C B D C S S

© 2012 Metamaxim Ltd Reasoning with Data Money Transfer by Instalment 1 Request QP 2 Instalment 3 “Thanks” P sends a Request for money to Q Q starts sends instalments to P. Once the cumulative instalments sent reaches the requested amount, Q stops sending and P says “Thanks”. Process: State Function: if (toPay ≤ 0) return “done”; else return “not done”; done P>Q:“Thanks” not done Q>P:Instalment C2 P>Q:Request toPay := Request.amount; Q>P:Instalment P>Q:“Thanks” toPay := toPay - Instalment.amount; C1 CHOREOGRAPHY = C1 || C2

© 2012 Metamaxim Ltd C2 * (Connected Form of C2) Reasoning with Data State Function: if (toPay ≤ 0) return “done”; else return “not done”; done P>Q:“Thanks” not done Q>P:Instalment C2 P>Q:“Thanks” Q>P:Instalment P>Q:Request Q>P:Instalment not done done P>Q:Request toPay := Request.amount; Q>P:Instalment P>Q:“Thanks” toPay := toPay - Instalment.amount; C1 P>Q:“Thanks” Q>P:Instalment C1 || C2 * Q>P:Instalment QP- P>Q:Request P