Chapter 8 TC & Cases

Download Report

Transcript Chapter 8 TC & Cases

Chapter 8 TC
TC 3 (parts a, b, c)
Authors Approach
• Do first cut sequence diagram including only actor and problem
domain classes.
• Add view layer and data access layer classes and redo sequence
diagram. (Note: there is little basis for the view layer or how it
operates.)
• Complete the design classes based on top two exercises
• Problems:
– Creation of sequence diagrams occurs several times and sequence
diagrams are complex and timely to create.
– Little understanding of how the use case is visualized, so classes added
might require revision or deletion.
– The use of controllers is undefined and rules for what type of object
should communicate with another are not defined, causing later
revisions in model.
– Design class attribution is a guess and might require changes later.
Robustness Approach
•
•
•
•
•
•
Build User Interface prototype explaining the visual solution to the use case.
Perform robustness to discover new controller classes and add UI classes
from prototype.
Confirm through robustness, applying rules, the flow of control in the use
case with all defined objects being added to model.
Develop sequence diagram adding methods to defined design classes.
Complete the design diagrams with discovered attributes.
Benefits:
– Allows visualization of the use case and thinking through the user view of the
problem.
– Robustness diagram is easy to draw and confirms the flow of execution through
the use case.
– Robustness rules create an executable relationship between objects that can be
implemented.
– A single sequence diagram is created with actual methods and method
signatures added to design classes.
– Design class attributes are completed based on UI prototype, method signatures,
and domain model
TC 3
(a)
Assumptions
• Each book is assigned a unique catalog
number.
• Book copies of a title can vary by edition
and ISBN number.
• The title definition consists of title, author,
publisher, and a category
• Titles are uniquely identified by title.
• Book copies are uniquely identified by
catalog number.
ERD for TC 3
BookTitle
PK
title
author
publisher
category
BookCopy
PK
catalognumber
FK1
edition
yearpublication
ISBN
checkoutstatus
datedueback
title
User Interface
Prototype
Add Copy
Catalog #
ISBN
Year
Menu
Book Title Search
Edition
Receive a Book
Exit
Submit
Cancel
Title
Author
Category
Catalog #
xxxxxxxxx
xxxxxxxxx
xxxxxxxxx
Search
Add Title
ISBN
Year
xxxxxxxxx xxxx
xxxxxxxxx xxxx
xxxxxxxxx xxxx
Add Title
Add Copy
Title Info
Copy Info
Edition
xx
xx
xx
Title
Catalog #
Author
ISBN
Cancel
Category
Year
Publisher
Edition
Submit
Cancel
Receive a Book
Robustness
AddCopy
(from Web Interface)
CSubmitButton
(from Web Interface)
CCancelButton
(from Web Interface)
submitcopy
cancel
AddCopyButton
addcopy
(from Web Interface)
submittitle
display
redirect AddCopy
AddTitleButton
TSubmitButton
(from Web Interface)
cancel
Librarian
(from Web Interface)
(from Actors)
redirect AddTitle
cancel
display
TitleSearch
(from Web Interface)
display
cancel
AddTitle
addcopy
(from Web Interface)
search
addtitle
cancel
cancel
SearchController
(from Business Servi ces)
CancelButton
returndata
(from Web Interface)
donemenu
TCancelButton
IN: menu to search for books
OUT: cancel or complete
return to menu
(from Web Interface)
createtitle
SearchButton
search
(from Web Interface)
AddController
lookup
createcopy
BookTitle
(from Business Dom ai n Classes)
lookup
DataSearchController
(from Business Servi ces)
BookCopy
(from Business Dom ai n Classes)
...)
(from Business Servi ces)
Receive a Book
Sequence
: Librarian : TitleSearch
: SearchController
: DataSearchController
: AddCopy
Normal Flow Add
Title
1: searchClick( )
: AddTitle : AddController : Menu
: BookTitle : BookCopy
2: DataSearchController( )
3: executesearch( )
4: searchTitle( )
5: addtitleClick( )
6: SearchController( )
7: dotitle( )
8: AddTitle( )
9: submitClick( )
10: AddController( )
11: createTitle( )
12: BookTitle()
13: addtitle()
14: BookCopy()
15: addbookcopy()
16: SearchController()
17: Menu()
Normal Flow Add
Copy
18: addcopyclick( )
19: SearchController( )
20: docopy( )
21: AddCopy( )
22: submitclick( )
23: AddController( )
24: createcopy( )
25: BookCopy()
26: addbookcopy()
27: SearchController()
28: Menu()
Design Classes Receive a Book
Design Process Review
Analysis
Use
Case
Description
Design
User
Interface
Prototype
Robustness
Analysis
Sequence
Diagram
Design
Class
Diagram
Domain
Class
Diagram
Windows or
pages and
overall flow to
use case
Discover objects,
confirm flow,
completeness
check
Construct object
messages and
define methods
for design
classes
Complete class
attribution
based on
domain model,
methods, and
UI prototype