150 likes | 242 Views
Chapters 10 and 31. System Sequence Diagrams. What is an SSD?. A diagram that illustrates input and output events related to the system Illustrates events from external actors
E N D
Chapters 10 and 31 System Sequence Diagrams CS6359 Fall 2011 John Cole
What is an SSD? • A diagram that illustrates input and output events related to the system • Illustrates events from external actors • It shows, for one particular scenario of a use case, the events that external actors generate, their order, and inter-system events • Systems are treated as black boxes; describe what they do but not how CS6359 Fall 2011 John Cole
Why use SSDs? • Software systems respond to events. • Systems react to 3 things: External events, timer events, and faults or exceptions • Therefore, identify precisely the external events CS6359 Fall 2011 John Cole
Naming Events and Operations • Keep the names as abstract or conceptual as possible • enterItem(itemID) is better than scan(itemID) • Start the name of the event with a verb CS6359 Fall 2011 John Cole
What SSD Info in the Glossary? • Since SSD elements are terse, include details such as the operation name, parameters, and return data. E. g., in the Process Sale example, “receipt” is shown. However, a receipt can be a complex document that should be defined. CS6359 Fall 2011 John Cole
Use Case for Process Sale CS6359 Fall 2011 John Cole
Process Sale SSD CS6359 Fall 2011 John Cole
Discussion of Process Sale • There is a loop for getting more items that returns a description and a total • The cashier can end the sale. The system returns the total with taxes CS6359 Fall 2011 John Cole
Iterative and Evolutionary SSDs • Don’t create them for all scenarios unless necessary • Use them to clarify a complex process • Have lots of explanatory text with the diagram • Create most of them during elaboration CS6359 Fall 2011 John Cole
SSD with Loop CS6359 Fall 2011 John Cole
Credit Payment • Assume amount tendered is the exact amount of the sale CS6359 Fall 2011 John Cole
Credit Payment • Card number and expiry date come from the card • The messages are synchronous, although they could be calls to Web services, AJAX, etc. CS6359 Fall 2011 John Cole
Contract: makeCreditPayment • Preconditions: • Operation: makeCreditPayment(CardNumber, expiryDate) • Cross Ref: Use Cases: Process Sale • Precondition: A sale is underway and all items have been entered. CS6359 Fall 2011 John Cole
Contract: makeCreditPayment • Postconditions: • A creditPaymentpmt was created • Pmt was associated with the current Sale sale • A Credit Card cc was created; cc.number = CardNumber and cc.expiry= ExpiryDate • Cc was associated with pmt • A CreditPaymentRequestcpr was created • Pmt was associated with cpr • A ReceivableEntry re was created • Re was assocaited with the external AccountsReceivable • Sale was associated with the Store as a completed sale CS6359 Fall 2011 John Cole
Monopoly SSD • P. 179 CS6359 Fall 2011 John Cole