Upload
nova
View
22
Download
1
Embed Size (px)
DESCRIPTION
An Introduction to Object-Oriented Systems Analysis and Design with UML and the Unified Process McGraw-Hill, 2004 Stephen R. Schach [email protected]. CHAPTER 7 — Unit A. THE ANALYSIS WORKFLOW II. Chapter Overview. Extracting Entity Classes: MSG Foundation Case Study - PowerPoint PPT Presentation
Citation preview
Slide 7A.1
Copyright © 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, 2004
Stephen R. Schach
Slide 7A.2
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
CHAPTER 7 — Unit A
THE ANALYSIS WORKFLOW II
Slide 7A.3
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter Overview
Extracting Entity Classes: MSG Foundation Case Study
Initial Functional Model: MSG Foundation Case Study
Initial Class Diagram: MSG Foundation Case Study Back to the Requirements Workflow Initial Dynamic Model: MSG Foundation Case Study Revising the Entity Classes: MSG Foundation Case
Study Extracting Boundary Classes: MSG Foundation
Case Study
Slide 7A.4
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter Overview (contd)
Extracting Control Classes: MSG Foundation Case Study
Use-Case Realization: MSG Foundation Case Study Incrementing the Class Diagram More on Actors More on Use Cases Risk Rapid Prototyping Scenarios and the Client’s Needs
Slide 7A.5
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Extracting Entity Classes: MSG Foundation
Entity class extraction is performed by iterating three steps– Functional modeling– Class modeling– Dynamic modeling
Slide 7A.6
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Extracting Entity Classes: MSG Foundation
The first step is to perform functional modeling
Slide 7A.7
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Initial Functional Model: MSG Foundation
The seventh iteration of the use-case diagram
Slide 7A.8
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Manage a Mortgage Use Case
One possible extended scenario
Slide 7A.9
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Manage a Mortgage Use Case (contd)
A second extended scenario
Slide 7A.10
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Estimate Funds Available for Week Use Case
One possible scenario
Slide 7A.11
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Produce a Report Use Case
One possible scenario
Slide 7A.12
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Produce a Report Use Case (contd)
Another possible scenario
Slide 7A.13
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Class Modeling
The second step of entity class extraction is class modeling– The two-stage noun extraction method is used
Slide 7A.14
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Noun Extraction: MSG Foundation
Stage 1: Describe the information system in a single paragraph– Weekly reports are to be printed showing how much
money is available for mortgages. In addition, lists of investments and mortgages must be printed on demand.
Slide 7A.15
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Noun Extraction: MSG Foundation (contd)
Stage 2: Identify the nouns in this paragraph– Weekly reports are to be printed showing how much
money is available for mortgages. In addition, lists of investments and mortgages must be printed on demand.
The nouns are report, money, mortgage, list, and investment
Slide 7A.16
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Noun Extraction: MSG Foundation (contd)
Nouns report and list are not long lived, so they are unlikely to be entity classes (report will surely turn out to be a boundary class),
money is an abstract noun
This leaves two candidate entity classes– Mortgage Class and Investment Class
Slide 7A.17
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
First Iteration of the Initial Class Diagram
Slide 7A.18
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Second Iteration of the Initial Class Diagram
Operations performed on the two entity classes are likely to be very similar– Insertions, deletions, and modifications
All members of both entity classes have to be printed on demand– Mortgage Class and Investment Class should be
subclasses of a superclass called Asset Class
Slide 7A.19
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Second Iteration of Initial Class Diagram (contd)
Slide 7A.20
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Back to the Requirements Workflow
The current 5 use cases include Manage a Mortgage and Manage an Investment
These can now be combined into a single use case, Manage an Asset
Slide 7A.21
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Eighth Iteration of the Use-Case Diagram
The new use case is shaded
Slide 7A.22
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Second Iteration of Initial Class Diagram (contd)
Now the attributes are added
Slide 7A.23
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Iteration and Incrementation
The phrase “iterate and increment” also includes the possibility of having to decrement what has been developed to date– A mistake may have been made, and backtracking is
needed– As a consequence of reorganizing the UML models, one
or more artifacts may have become superfluous
Slide 7A.24
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Initial Dynamic Model: MSG Foundation
The third step is dynamic modeling– A statechart is drawn that reflects all the operations,
showing the events that cause the transition from state to state
The major source of information regarding the relevant operations is the scenarios
Slide 7A.25
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study
Slide 7A.26
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study (contd)
The statechart reflects the operations of the complete MSG Foundation information system– The solid circle on the top left represents the initial state,
the starting point of the statechart– The white circle containing the small black circle on the
top right represents the final state– States other than the initial and final states are
represented by rectangles with rounded corners– The arrows represent possible transitions from state to
state
Slide 7A.27
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study (contd)
In state MSG Foundation Information System Loop, one of five events can occur
An MSG staff member can issue one of five commands: – estimate funds for the week– manage an asset– update estimated annual operating expenses– produce a report, or– quit
Slide 7A.28
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study (contd)
These possibilities are indicated by the five events – estimate funds for the week selected– manage an asset selected– update estimated annual operating expenses selected– produce a report selected, and – quit selected
An event causes a transition between states
Slide 7A.29
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study (contd)
An MSG staff member selects an option by clicking on the menu
This graphical user interface (GUI) requires special software
Slide 7A.30
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study (contd)
Here is an equivalent textual user interface that can run on any computer
Slide 7A.31
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Statechart: MSG Foundation Case Study (contd)
Example:– The MSG staff member clicks on the choice Manage an
asset – The event “manage an asset selected” has now occurred– The system moves from its current state, MSG
Foundation Information System Loop, to the state Managing an Asset
– The operations that the MSG staff member can perform in this state» Add, delete, or modify a mortgage or investment
appear below the line in the box with rounded corner
Slide 7A.32
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Revising the Entity Classes: MSG Case Study
The initial functional model, the initial class diagram, and the initial dynamic model are completed– Checking them reveals a fault
In the initial statechart, consider state Update Estimated Annual Operating Expenses with operation Update the estimated annual operating expenses– This operation has to be performed on the current value of
the estimated annual operating expense
Slide 7A.33
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Revising the Entity Classes: MSG (contd)
But where is the value of the estimated annual operating expenses to be found?
Currently there is only one class (Asset Class) and its two subclasses– Neither is appropriate for storing the estimated annual
operating expenses
Slide 7A.34
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Revising the Entity Classes: MSG (contd)
The only way a value can be stored on a long-term basis is as an attribute of an instance of that class or its subclasses
Another entity class is needed in which the estimated annual operating expenses can be stored– MSG Application Class
Slide 7A.35
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Third iteration of the initial class diagram: MSG
MSG Application Class has other attributes as well– Attributes
that do not appertain to the assets
Slide 7A.36
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Continued in Unit 7B