华师大面向对象程序设计-Lec10_中的顺序图Object oriented Analysis &Design面向对象分析与设计 System Sequence Diagram Operation Contract Presented by: Xiaohong Chen Outline System sequence diagram Identify system events. Create system sequence diagrams for use case scenarios. Operation contract 2 3 (Ch10,15 ) System Sequence Diagram SSD: System Sequence Diagram What is SSD? A SSD is a picture that shows, for one particular scenario of a use case, the events that external actors generate, inter-system events , and their order All systems are treated as a black box; the emphasis of the diagram is events that cross the system boundary from actors to systems System Event external input events actor generates events to a system system operation to handle the system event , for example when a cashier enters an item's ID, the cashier is requesting the POS system to record that item's sale (the enterItem event). That event initiates an operation upon the system. 4 (Ch10,15 ) System Sequence Diagram 5 (Ch10,15 ) System Sequence Diagram Cf: SSD & SD SSD: to emphasize to treat systems as black boxes. SD will be used to illustrate the design of interacting software objects to fulfill work SSD and Use case it is generated from inspection of a use case 6 Fig 10-3 7 Fig 10-5 8 SD example,fig15-3 初学建模者没有对交互图给予足够的重视 Above sequence diagram is read as follows: The message makePayment is sent to an instance of a Register. The sender is not identified. The Register instance sends the makePayment message to a Sale instance. The Sale instance creates an instance of a Payment. 9 Example public class A { private B myB = new B(); public void doOne() { (); (); } // … } public class B { …. public void doTwo() { …. } public void doThree(){ ……; } // … } What class A&B looks like? (write pseudocode ) 10 SD review Fig 15-5 Lifeline boxes to show participants in interactions.