An Introduction to Object-Oriented Systems Analysis and Design with UML and the Unified Process McGraw-Hill, 2004 Stephen R. Schach [email protected] 6 — Unit CSlide 3Buy a Masterpiece Use Case (contd)Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Interaction DiagramsSlide 20Slide 21Buy a Masterwork Use Case (contd)Slide 23Slide 24Slide 25Slide 26Slide 27Slide 28Slide 29Buy Other Painting Use CaseBuy Other Painting Use Case (contd)Modifying the Main MenuModifying the Main Menu (contd)Sell a Painting Use Case (contd)Slide 35Slide 6C.1Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction toObject-Oriented Systems Analysis and Design with UML and the Unified Process McGraw-Hill, 2004Stephen R. [email protected] 6C.2Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. CHAPTER 6 — Unit CTHE ANALYSIS WORKFLOW ISlide 6C.3Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Continued from Unit 6BSlide 6C.4Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 1: –In paragraph 1 of this scenario, Osbert inputs the details of the masterpiece he is considering buying–In the collaboration diagram, this is modeled by message»1: Give masterpiece details –from Osbert to the object :UserInterfaceClassSlide 6C.5Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 2: –In paragraphs 2 and 3 of the scenario, the maximum purchase price is computed by comparing the masterpiece under consideration with masterpieces that have previously been auctioned–This computation is performed by an instance of the control class, namely, object :ComputeMasterpiecePriceClass–To do this, details of the masterpiece under consideration need to be transferred from object :UserInterfaceClassto object :ComputeMasterpiecePriceClass–This is modeled by message»2: Transfer masterpiece detailsSlide 6C.6Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 3:–To do the comparison, object :ComputeM asterpiecePriceClass has to create a masterpiece object–It first creates an instance of MasterpieceClass–This is modeled by message»3: Create new object from :ComputeMasterpiecePriceClass to : MasterpieceClass–The [new] inside the object indicates that it is created as a consequence of the message–The new object is passed back to :ComputeMasterpiecePriceClass, modeled by message»4: Return new objectSlide 6C.7Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 4:–:ComputeMasterpiecePriceClass compares the masterpiece under consideration with each of the previously auctioned masterpieces–It browses through all the instances of AuctionedPaintingClass–This is modeled by message»5: Browse auctioned paintings from :ComputeMasterpiecePriceClass to :AuctionedPaintingClass and by message»6: Return auctioned paintingin the reverse directionSlide 6C.8Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 5:–Having found the best match, :ComputeMasterpiecePriceClass computes the maximum price to be offered and informs Osbert what that price is–The price is transferred from : ComputeMasterpiecePriceClass to the user interface object :UserInterfaceClass so that the price can be displayed–This is modeled by message»7: Provide price–Next the price is displayed for Osbert by the message»8: Display priceSlide 6C.9Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 6:–Osbert makes an offer for the masterpiece»The comment below paragraph 3 of the scenario states that the offer is accepted–Osbert now enters details provided by the seller–This is modeled by message»9: Give seller detailsfrom Osbert to object : User I nterf aceClass–The note indicates that the data are provided by the seller to OsbertSlide 6C.10Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 7:–The seller data are passed on to object :ComputeMasterpiecePriceClass–This is modeled by message»10: Transfer seller detailsto update the details of the masterpiece object :MasterpieceClass–This is modeled by message»11: Request updateSlide 6C.11Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Item 8:–:MasterpieceClass then sends an acknowledgment to : ComputeMasterpiecePriceClass–This is modeled by message»12: Send acknowledgment–This acknowledgment is then passed on to the user interface object :UserInterf aceClass –This is modeled by message»13: Send acknowledgment–:UserInterfaceClass now displays it for Osbert –This is modeled by message»14: Display acknowledgmentSlide 6C.12Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Osbert will not approve the specification document unless he understands itAccordingly, a written description of the collaboration diagram is needed–The flow of eventsSlide 6C.13Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)The flow of events of the collaboration diagram of the realization of the scenario of the use caseSlide 6C.14Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)UML supports two different types of interaction diagram–Collaboration diagram–Sequence diagramBoth contain exactly the same information, but displayed in different waysSlide 6C.15Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)Sequence diagram equivalent to the collaboration diagram (of the realization of the scenario of the use case)Slide 6C.16Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Buy a Masterpiece Use Case (contd)The
View Full Document