bts430 systems analysis and design using uml interaction diagrams
TRANSCRIPT
![Page 1: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/1.jpg)
BTS430 Systems Analysis and Design using UML
Interaction Diagrams
![Page 2: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/2.jpg)
Definition
An interaction diagram illustrates how objects interact using messages for a given scenario.
UML has two main types—sequence and communication.
![Page 3: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/3.jpg)
Definition
Interaction diagrams “force us to think through the concrete details of what messages to send and to whom and in what order”. text, p.225
They define how we meet our “operation contracts”.
![Page 4: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/4.jpg)
Sequence Diagrams
: Register : Sale
makePayment(cashTendered)
makePayment(cashTendered)
: Paymentcreate(cashTendered)
UI Layer
Domain Layer
![Page 5: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/5.jpg)
Sequence Diagrams
:ProcessSaleFrame
UI Layer
Domain Layer
makePayment(cashTendered)
: Register : Sale
makePayment(cashTendered)
makePayment(cashTendered)
: Paymentcreate(cashTendered)
makePayment(cashTendered)
![Page 6: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/6.jpg)
Participants
Lifeline Boxes (roughly equal to class instances)
Common cases of notation:
:Sale s1:Sale
unnamed instance named instance
![Page 7: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/7.jpg)
Messages
Occur between objects Starting messages are initiated by a random
source or a specific source
:Register :Register
Random Source Specific Source
![Page 8: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/8.jpg)
Message Expression Syntax
see page 227 Examples:
startSale() or startSale desc=getDescription(itemID) OR
getDescription(itemID), with “product description” shown as a return
![Page 9: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/9.jpg)
Returns
:Register :Sale
makePayment(cashTendered)
change due
makePayment(cashTendered)
OR
changeDue=makePayment(cashTendered)
![Page 10: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/10.jpg)
Object Creation
:Register :Sale
makePayment(cashTendered)
:Paymentcreate(cashTendered)
makePayment(cashTendered)
invokes the “new” operator and calls the constructor:public class Sale{private Payment payment;public void makePayment( Money cashTendered ){ payment = new Payment( cashTendered );….and so on
![Page 11: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/11.jpg)
Object Destruction
:Register :Sale
makePayment(cashTendered)
:Paymentcreate(cashTendered)
makePayment(cashTendered)
Payment object destroyed
…
<<destroy>>
X
![Page 12: BTS430 Systems Analysis and Design using UML Interaction Diagrams](https://reader035.vdocuments.us/reader035/viewer/2022071718/56649efa5503460f94c0c24b/html5/thumbnails/12.jpg)
Messages to Self
:Register
newSale()
clear()
…