Download presentation
Presentation is loading. Please wait.
1
Slide 6A.1 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. An Introduction to Object-Oriented Systems Analysis and Design with UML and the Unified Process McGraw-Hill, 2004 Stephen R. Schach srs@vuse.vanderbilt.edu
2
Slide 6A.2 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. CHAPTER 6 — Unit A THE ANALYSIS WORKFLOW I
3
Slide 6A.3 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter Overview l The Analysis Workflow l Extracting Entity Classes l Initial Functional Model: Osbert Oglesby Case Study l Initial Class diagram: Osbert Oglesby Case Study l Initial Dynamic Model: Osbert Oglesby Case Study l Extracting Boundary Classes l Extracting Control Classes l Refining the Use Cases l Use-Case Realization l Incrementing the Class Diagram l Where’s the Specification Document?
4
Slide 6A.4 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. The Aims of the Analysis Workflow l To obtain a deeper understanding of the requirements l To describe the requirements in a way that is –Easy to maintain, and –Provides insights into the structure of the target information system
5
Slide 6A.5 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Classes l The three class types in the Unified Process are –Entity classes –Boundary classes –Control classes l UML notation
6
Slide 6A.6 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Entity Classes l An entity class models information that is long lived l Examples: –Account Class in a banking information system –Painting Class in the Osbert Oglesby information system –Mortgage Class and Investment Class in the MSG Foundation information system l Instances of all these classes remain in the information system for years
7
Slide 6A.7 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Boundary Classes l A boundary class models the interaction between the information system and its actors l Boundary classes are generally associated with input and output l Examples: –Purchases Report Class and Sales Report Class in the Osbert Oglesby information system –Mortgage Listing Class and Investment Listing Class in the MSG Foundation information system
8
Slide 6A.8 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Control Classes A control class models complex computations and algorithms Examples: –Compute Masterpiece Price Class, –Compute Masterwork Price Class, and –Compute Other Painting Price Class in the Osbert Oglesby information system
9
Slide 6A.9 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Stereotypes l UML notation for these three types of classes l These are stereotypes (extensions of UML) –UML allows us to define additional constructs that are not part of UML but which we need in order to model a system accurately
10
Slide 6A.10 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. The Unified Process and Classes l The Unified Process does not describe how classes are extracted –Users of the Unified Process are expected to have a background in object-oriented analysis and design l We temporarily suspend this discussion of the Unified Process to explain how classes are extracted, and then return to the Unified Process
11
Slide 6A.11 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Extracting Entity Classes l Entity class extraction consists of three steps that are carried out iteratively and incrementally: –Functional modeling »Present scenarios of all the use cases (a scenario is an instance of a use case) –Class modeling »Determine the entity classes and their attributes »Determine the interrelationships and interactions between the entity classes »Present this information in the form of a class diagram –Dynamic modeling »Determine the operations performed by or to each entity class »Present this information in the form of a statechart
12
Slide 6A.12 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Flowchart for Extracting Entity Classes
13
Slide 6A.13 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Initial Functional Model: Osbert Oglesby l Recall the Osbert Oglesby use-case diagram:
14
Slide 6A.14 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Use Case and Scenario l A use case depicts all possible interactions of a specific kind l A scenario is an instance of a use case –(Just as an object is an instance of a class)
15
Slide 6A.15 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Scenario of Use Case Buy a Painting
16
Slide 6A.16 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Scenario of Use Case Buy a Painting (contd) l This is a normal scenario l There are six paragraphs in the scenario –Only four of them are numbered –The two unnumbered sentences »“Osbert wishes to buy a masterpiece” and »“Osbert makes an offer below the maximum purchase price—the offer is accepted by the seller” have nothing to do with the interaction between Osbert and the information system –These unnumbered paragraphs are essentially comments
17
Slide 6A.17 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Second Scenario of Use Case Buy a Painting l This is an exception scenario –It models an interaction that is not “normal”
18
Slide 6A.18 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Third Scenario of Use Case Buy a Painting l This is another exception scenario
19
Slide 6A.19 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Normal and Exception Scenarios l Normal and exception scenarios can be combined into an extended scenario
20
Slide 6A.20 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Initial Functional Model (contd) l The systems analysis team investigates as many normal and exception scenarios of each use case as time permits –To get the deepest possible understanding of »The domain »The business model, and »The use cases
21
Slide 6A.21 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Initial Class Diagram: Osbert Oglesby Case Study l The second step in extracting the entity classes is class modeling –The aim of this step is to extract the entity classes, determine their interrelationships, and find their attributes l Usually, the best way to begin this step is to use the two-stage noun extraction method –Stage 1: Describe the information system in a single paragraph –Stage 2: Identify the nouns in this paragraph, then select the entity classes from those nouns
22
Slide 6A.22 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Noun Extraction: Osbert Oglesby Case Study l Stage 1: Describe the information system in one paragraph: –Reports are to be generated in order to improve the effectiveness of the decision-making process for buying works of art. The reports contain buying and selling information about paintings, which are classified as masterpieces, masterworks, and other paintings
23
Slide 6A.23 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Noun Extraction: Osbert Oglesby (contd) l Stage 2: Identify the nouns in this paragraph –Reports are to be generated in order to improve the effectiveness of the decision-making process for buying works of art. The reports contain buying and selling information about paintings, which are classified as masterpieces, masterworks, and other paintings l The nouns are report, effectiveness, process, buying, work of art, selling, information, painting, masterpiece, and masterwork
24
Slide 6A.24 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Noun Extraction: Osbert Oglesby (contd) l effectiveness, process and information are abstract nouns and are therefore unlikely to be entity classes –Abstract nouns identify things that have no physical existence l Nouns buying and selling are derived from the verbs “buy” and “sell” –They will probably be operations of some class
25
Slide 6A.25 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Noun Extraction: Osbert Oglesby (contd) l Noun report is unlikely to be an entity class, because a report is not long lived –A report is much more likely to be a boundary class l Noun work of art is just a synonym for painting
26
Slide 6A.26 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. First Iteration of the Initial Class Diagram l This leaves four candidate entity classes: –Painting Class, Masterpiece Class, Masterwork Class, and Other Painting Class
27
Slide 6A.27 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Second Iteration of the Initial Class Diagram l Consider the interrelationships between the entity classes l A masterpiece is a specific type of painting, and so is a masterwork and an “other painting” –Painting Class is therefore the base class –Masterpiece Class, Masterwork Class, and Other Painting Class are subclasses of that base class
28
Slide 6A.28 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Second Iteration of Initial Class Diagram (contd)
29
Slide 6A.29 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. l The class diagram does not reflect aspects of the pricing algorithm l When dealing with a masterwork –“The information system first computes the maximum purchase price as if it were a masterpiece by the same artist” Third Iteration of the Initial Class Diagram
30
Slide 6A.30 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. l That is, a masterwork has to have all the attributes of a masterpiece (so that its maximum purchase price can be computed as if it were a masterpiece) and, in addition, it may have attributes of its own –This is modeled in the next slide Third Iteration of the Initial Class Diagram (contd)
31
Slide 6A.31 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Third Iteration of the Initial Class Diagram (contd)
32
Slide 6A.32 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fourth Iteration of the Initial Class Diagram l Another aspect of the pricing algorithm that is not reflected in the current class diagram is –“The information system computes the coefficient of similarity between each painting for which there is an auction record and the painting under consideration for purchase”
33
Slide 6A.33 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fourth Iteration of the Initial Class Diagram (contd) l Auctioned Painting Class is needed to make these comparisons –An auctioned painting must be a subclass of Painting Class –But a painting previously been sold at an auction somewhere in the world has nothing to do with paintings currently on display for sale in Osbert’s gallery
34
Slide 6A.34 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fourth Iteration of the Initial Class Diagram (contd)
35
Slide 6A.35 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fourth Iteration of the Initial Class Diagram (contd) l An instance of Painting Class is either –A painting that Osbert has bought (an instance of Gallery Painting Class), or –A painting sold at some auction (an instance of Auctioned Painting Class)
36
Slide 6A.36 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fifth Iteration of the Initial Class Diagram l A third aspect of the maximum price algorithm that has not yet been modeled is fashionability –“The information system computes the maximum purchase price from the formula F A, where F is a constant for that artist (fashionability coefficient) …” l Fashionability Class is needed –A painting of Other Painting Class can then use the instance of Fashionability Class for that artist to compute the maximum price that Osbert should offer to pay
37
Slide 6A.37 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fifth Iteration of the Initial Class Diagram (contd)
38
Slide 6A.38 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Initial Class Diagram: Osbert Oglesby Case Study l Why was the first iteration of the class diagram so inadequate? –The Osbert Oglesby case study appears to be a straightforward data-processing application –The one-paragraph description correctly did not incorporate the pricing algorithm l Unfortunately, the algorithmic details turned out to be critical to the class diagram
39
Slide 6A.39 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Initial Class Diagram: Osbert Oglesby (contd) l The first iteration of the class diagram was no good –However, repeated iteration and incrementation led to a reasonable class diagram l This demonstrates the power of the iterative and incremental approach
40
Slide 6A.40 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Initial Class Diagram (contd) l Finally, we add the attributes of each class to the class diagram –For the Osbert Oglesby case study, the result is shown on the next slide l The empty rectangle at the bottom of each box will later be filled with the operations of that class
41
Slide 6A.41 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fifth Iteration of the Initial Class Diagram (contd)
42
Slide 6A.42 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fifth Iteration of the Initial Class Diagram (contd) l Osbert Oglesby Application Class will contain the operation that starts execution of the whole information system
43
Slide 6A.43 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Fifth Iteration of the Initial Class Diagram (contd) l The next slide shows the fifth iteration of the initial class diagram, without the attributes, but explicitly reflecting the stereotypes –All eight classes in that figure are entity classes, that is, they model long-lived information l This is also a class diagram –A class diagram depicts classes and their interrelationships; attributes and operations are optional
44
Slide 6A.44 Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Continued in Unit 6B
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.