Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jan 23, 200291. 3913 Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented.

Similar presentations


Presentation on theme: "Jan 23, 200291. 3913 Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented."— Presentation transcript:

1 Jan 23, 200291. 3913 Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented programming when we say a message foo invokes the method foo

2 Jan 23, 200291. 3913 Ron McFadyen2 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented programming when we say a message foo invokes the method foo We’ll refer to this as the enterItem system operation

3 Jan 23, 200291. 3913 Ron McFadyen3 Messages sent for enterItem( … ) Figures 17.8, 20.6 This diagram shows a collaboration among objects. The collaboration is a sequence of messages. They occur in response to the system event enterItem. We’ll explain this diagram, but note that we’ll study the notation more thoroughly in future lectures

4 Jan 23, 200291. 3913 Ron McFadyen4 Messages sent for enterItem( … ) Figures 17.8, 20.6 The messages are sent in the order: 1, 1.1, 2, 2.1, 2.2.

5 Jan 23, 200291. 3913 Ron McFadyen5 Messages sent for enterItem( … ) Figures 17.8, 20.6 The diagram would be created if the designer thought the illustration would be useful … to communicate to someone how the system will work.

6 Jan 23, 200291. 3913 Ron McFadyen6 Messages sent for enterItem( … ) Figures 17.8, 20.6 The system operation is received by the Register object. On page 314 you’ll note that Register has an enterItem method.

7 Jan 23, 200291. 3913 Ron McFadyen7 Messages sent for enterItem( … ) Figures 17.8, 20.6 The register object sends a message to the product catalogue. (The register will eventually tell the sale object to create a line for this.)

8 Jan 23, 200291. 3913 Ron McFadyen8 Messages sent for enterItem( … ) Figures 17.8, 20.6 The catalogue will search the catalogue data structure for the item that was scanned at the register. Note that on Page 314 the Java code only has to invoke the get method for the HashMap.

9 Jan 23, 200291. 3913 Ron McFadyen9 Messages sent for enterItem( … ) Figures 17.8, 20.6 The sale object is sent a message that will cause it to create a new sales line

10 Jan 23, 200291. 3913 Ron McFadyen10 Messages sent for enterItem( … ) Figures 17.8, 20.6 A new sales line is created

11 Jan 23, 200291. 3913 Ron McFadyen11 Messages sent for enterItem( … ) Figures 17.8, 20.6 The newly created sales line will be added to the collection of lines belonging to this sale.

12 Jan 23, 200291. 3913 Ron McFadyen12 Domain Model Use Case Model text diagram SSD System operation contracts Design Model Figure 13.3

13 Jan 23, 200291. 3913 Ron McFadyen13 Contracts A technique for describing system operations in terms of state changes to objects in a Domain Model major proponent - Bertrand Meyer based on concept of assertion a statement, a declaration, that must be true a false value indicates a bug UML has OCL - very formal syntax which we will ignore at the requirements gathering stage, these are informal and likely incomplete

14 Jan 23, 200291. 3913 Ron McFadyen14 Contracts Contract Components Operation - name and parameters Cross References - where operation used Preconditions - assumptions about the state of the system or Domain Model objects Postconditions - state of objects after the operation completes objects:any new ones? any attributes modified? associations: any new or modified associations? Larman’s version is very informal - focus on what, not how

15 Jan 23, 200291. 3913 Ron McFadyen15 SalesLineItem quantity Product Specification itemID Sale 1 1..* * 1Described by Contained in The part of the Domain Model that is relevant to enterItem( )

16 Jan 23, 200291. 3913 Ron McFadyen16 Contracts Example Operation enterItem (itemID : ItemID, quantity : integer) Cross References Use Case Process Sale PreconditionsThere is a sale underway Postconditions - a SalesLineItem instance was created - an association between the sale and the sales line item was created - an attribute, quantity, was modified - an association between the product specification and the sales line item was created

17 Jan 23, 200291. 3913 Ron McFadyen17 OCL Object Constraint Language UML has a formal language for specifying constraints on object-oriented models context Salesperson:: sell ( item: Thing ) : Real pre: self.sellableItems -> includes (item) post: not self.sellableItems -> includes (item) and result=item.price

18 Jan 23, 200291. 3913 Ron McFadyen18 Ch 15. Interaction Diagrams Now, we are shifting towards design - how do the objects in the model interact? Interaction Diagram - illustrates how objects collaborate to fulfill requirements - the messages that are sent from one object to another collaboration diagrams sequence diagrams

19 Jan 23, 200291. 3913 Ron McFadyen19 SalesLineItem quantity Product Specification itemID Sale makePayment() 1 1..* * 1Described by Contained in More of the Domain Model - we’ve included some methods Register makePayment() Payment create() 1 * 1 1 Captured on Paid by

20 Jan 23, 200291. 3913 Ron McFadyen20 Figure 15.3 Collaboration Diagram

21 Jan 23, 200291. 3913 Ron McFadyen21 Figure 15.4 Sequence Diagram


Download ppt "Jan 23, 200291. 3913 Ron McFadyen1 SSD for a samplePOS Use Case Figure 13.1 Input Events invoke a system operation of the same name same idea as in object-oriented."

Similar presentations


Ads by Google