Professional Documents
Culture Documents
Design Ii: Detailed Design
Design Ii: Detailed Design
DESIGN II:
DETAILED DESIGN
Develop Software Engineering
Architecture Roadmap:
- see chapter 5 Chapter 6 Focus
Analyze Maintain
requirements
Integrate
Design & test system
Implement Test units
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Chapter Learning Goals
• Understand how design patterns
describe some detailed designs
• Specify algorithms
– use flowcharts
– use pseudocode
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
1. Introduction to Detailed Design
Objective: To fully prepare for implementation of a
system that meets requirements.
Outcomes: (1) blueprints (models),
(2) associated details (documentation),
(3) detailed implementation plan for construction,
integration and testing
Relating Use Cases, Architecture, & Detailed Design
• Detailed Design
1. Begin with architectural models -- see chapter 5 Typical
• class model: domain & architectural classes Roadmap
• overall state model* for
• overall data flow model* Detailed
• use case model Design
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Organize the Team for Detailed Design 2/2
2. Hold the kick-off meeting
– Designate someone to monitor the agenda item time
– Confirm that the architecture is ready for detailed design
• Make sure that module interfaces the are clear
– revise as a group if not
• Don’t try to develop detailed designs as a group
– not necessary: individuals have the responsibility
– groups are seldom good at designing details together
– Allocate modules to members
• Request time estimates to design lead by a fixed date
– Write out the conclusions and copy/e-mail every member
– Decide how and when the results are to be reviewed
3. Update the documentation set
– more detailed schedule with modules & inspections
4. Inspect the detailed designs (see section 9)
5. Rework as a result of inspections
6. Conduct post mortem and write out lessons learned
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Unified Software Development Process: Design
U. P. Term Inception Elaboration Construction Transition
Requirements
1* Jacobson et al:
Analysis
2
3 Design
Implemen-
tation
Test
(Jacobson et al) Prelim. Iter. Iter. Iter. Iter. Iter. ….. Iter.
…..
iterations #1 #n #n+1 #m #m+1 #k
*Key: terminology “Detailed
used in this book 1 = “Requirements” 2 = “Achitecture” 3= design”
Analysis Design 1/2
After Jacobson
1. Conceptual & abstract 1. Concrete: et al: USDP
implementation
blueprint
2. Applicable to several 2. Specific for an
designs implementation
3. «control», «entity» & 3. No limit on class
«boundary» class stereotypes
stereotypes
4. Less formal 4. More formal
5. Less expensive to 5. More expensive to
develop develop (~ 5 times)
Analysis Design 2/2 After Jacobson
et al: USDP
BillingClient Customer
listCustomers() bill()
billCustomers() printAccounts()
-- written in terms of
Customer (not Abstract layer
specific types of
Customer) RegularCustomer
bill()
printAccounts()
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Refine Models for Detailed Design
2/2: Data Flow Diagrams
1. Gather data flow diagrams (DFD’s) constructed for
detailed requirements and/or architecture (if any).
2. Introduce additional DFD’s, if necessary, to explain
data and processing flows.
3. Indicate what part(s) of the other models the DFD’s
corresponds to.
– e.g., “the following DFD is for each Account object”
4. Provide all details on the DFD’s
– indicate clearly the nature of the processing at each node
– indicate clearly the kind of data transmitted
– expand processing nodes into DFD’s if the processing
description requires more detail
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Requirements: Sequence Diagram for
Engage Foreign Character Use Case
:Encounter freddie: :Engagement :Engagement
Game Foreign Display
Character
:Player
Character
1.1 create; display
1.2 create
2.1 execute
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
:Encounter :Encounter freddie: engagement:
game Cast Foreign Engagement
Character
1.1 displayForeignChar()
2.3 setForeignQuality()
3.1 new EngagementDisplay()
2.4 setQuality()
3.2 displayResult()
Engagement EngagementDisplay
execute() displayResult()
EncounterGame
PlayerCharacter
EncounterCast setQuality()
displayForeignChar()
setPlayerQuality()
ForeignCharacter
setForeignQuality()
setQuality()
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Detailed Data Flow Diagram for a Banking
Application
customer
Account. info Customer.
User getDetails()
getDeposit()
Account
Cus-
tomer
screen unacceptable
template local ATM users
log
Deposit-
screen. Account.
display() getPass-
Account. word()
status verifyPass- pass-
word() word
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
CRC Cards
• Exercise:
• Use Case: You are registering for a new
course in astronomy. You require
permission from the instructor and you must
interact with the registrars office to signup
and pay for the course.
• Develop the classes and responsibilities
using CRC cards
3. Specifying classes and functions
Specify A Class
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Classes at Detailed Design
Data type
Range
Default value
Security issues Canister Class name
+ numCanisters: int
- numWafers: int Attribute: type
- size: float
+: visible + display()
from without - getNumSlotsOpen() Operations
+ setStatus()
Interface specs Responsibilities:
Place for
Functional -- describes each comments
details canister undergoing
Invariants fabrication Instance details
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
4. Specifying algorithms
Flowchart
Example
N Parameter & Y
for setName() settings make Nominal path
sense?
Set _name to
“defaultName"
N Parameter Y
protected final void setName( String aName ) name too
{ long?
// Check legitimacy of parameter and settings
if( ( aName == null ) || ( maxNumCharsInName() <= 0 ) ||
( maxNumCharsInName() > alltimeLimitOfNameLength() ) )
{ _name = new String( "defaultName" );
System.out.println
( "defaultName selected by GameCharacter.setName()");
}
Set _name Truncate
else
// Truncate if aName too long to parameter name
if( aName.length() > maxNumCharsInName() )
_name = new String
( aName.getBytes(), 0, maxNumCharsInName() );
else // assign the parameter name
_name = new String( aName );
} Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Pseuodocode Example
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Disadvantages of Pseudocode & Flowcharts
Creates an additional level of documentation to
maintain
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
5. Design Patterns II: Techniques of
detailed design
Apply Design Patterns in Detailed Design
1. Become familiar with the design problems solved by
design patterns
– at a minimum, understand the distinction among (C)
creational vs. (S) structural vs. (B) behavioral patterns
Consider each part of the detailed design in turn:
2. Determine whether the problem has to do with (C)
creating something complex, (S) representing a
complex structure, or (B) capturing behavior
3. Determine whether there is a design patterns that
addresses the problem
– try looking in the category identified (C, S, or B)
• use this book and/or Gamma et al [Ga]
4. Decide if benefits outweigh drawbacks
– benefits usually include increased flexibility
– drawbacks increased class complexity(?), less efficient(?)
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
User Interface Design
• System users often judge a system by its
interface rather than its functionality
• A poorly designed interface can cause a user
to make catastrophic errors
• Poor user interface design is the reason why
so many software systems are never used
User-Centred design
• User-centred design is an approach to UI
design where the needs of the user are
paramount and where the user is involved in
the design process
• UI design always involves the development
of prototype interfaces
• See UI_design.ppt
7. Standards, notation and tools for
detailed design
IEEE 1016-1987 Software Design Document Table of Contents (Reaffirmed 1993)
1. Introduction 4. Dependency description
1.1. Purpose Architecture 4.1 Intermodule dependencies
1.2. Scope 4.2 Interprocess dependencies
1.3.beDefinitions,
Can acronyms
replaced with: 4.3 Data dependencies
& abbreviations
6.1 Class#1 detailed design 5. Interface description
2. References 5.1 Module interface
6.1.1 Attributes
3. Decomposition description 5.1.1 Module 1 description
3.1.6.1.2 Methods
Module decomposition 5.1.2 Module 2 description
6.1.3 Instance1details
3.1.1 Module description 5.2 Process interface
6.1.4. Other: 2 description
3.1.1 Module 5.2.1 Process 1 description
- UI details
3.2 Concurrent (if applicable)
process 5.2.2 Process 2 description
decomposition 6. Detailed design
3.2.1 Process 1 description 6.1 Module detailed design
3.2.2 Process 2 description 6.1.1 Module 1 detail
3.3 Data decomposition 6.2.2 Module 2 detail
3.3.1 Data entry 1 description 6.2 Data detailed design
3.3.2 Data entry 2 description 6.2.1 Data entity 1 detail
6.2.2 Data entity 2 detail
8. Effects on projects of completing
detailed designs
1. Make sure the SDD reflects latest version of detailed
design, as settled on after inspections.
2. Give complete detail to the schedule (SPMP).
3. Allocate precise tasks to team members (SPMP).
4. Improve project cost & time estimates (see below).
5. Update the SCMP to reflect the new parts.
6. Review process by which the detailed design was
created, & determine improvements. Include ...
– time taken; broken down to include
• preparation of the designs Bring the Project
• inspection Up-to-Date
• change After Completing
– defect summary Detailed Design
• number remaining open, found at detailed design, closed at
detailed design
• where injected; include previous phases & detailed design stages
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Estimate Size & Time from Detailed Designs
Severity Description
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Types of Defects (4)
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Types of Defects (5)
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Pseudocode
1 IF aQuality is not recognized for Inspection
2 Log error to log file
3 Inform user qualities unchanged
4 ELSE setQuality()
5 IF aQualityValue out of bounds should be
6 Log error to log file mentioned
7 Inform user qualities unchanged
8 ELSE
9 Set the stated quality to aQualityValue
10 Reduce the remaining qualities,
Make these ... retaining their mutual proportion,
preconditions; ... making the sum of qualities unchanged
don’t check. ENDIF
Lacks detail on how to allocate
ENDIF the remaining quality values
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Case Study
Detailed Design of RolePlayingGame Package
RPGame GameState
handleEvent() state handleEvent()
{ state.handleEvent(); }
....
Detailed Design of RolePlayingGame Package
MouseListener
{ rPGameS.handleEvent(); }
rPGameS RPGMouseEventListener
mouseEnter()
RPGame GameState
handleEvent() stateS handleEvent()
{ stateS.handleEvent(); }
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
User eventTarget :RPGame :GameState
:RPGMouseEventListener
1. mouse
action
2. mouseClicked()
3. handleEvent
( Event )
4. handleEvent
( Event)
Area EncounterAreaConnection
GameArtifacts
«framework package» ConnectionHyperlink
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
MouseListener
EncounterGameDisplays
EncounterDisplayItem EncounterCast
QualListDispl SetQualValueDispl
QualValueDispl
EngagementDisplay Reporting
handleEvent()
SetQualityDisplay Preparing
handleEvent()
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Sequence Diagram for
Dismissing Engagement
User :EngagementDisplay Display
1. hit :RPGMouse
dismiss EventListener :ReportingEncounter
button
2. mouseClicked() :EncounterGame
3. handleEvent()
4. handleEvent()
5. setVisible( false )
6. setState
(new Waiting())
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
Sequence Diagram for Player Completes Setup
1. hit :RPGMouse
dismiss EventListener
button
2. mouseClicked() :EncounterGame
3. handleEvent()
4. handleEvent()
5. setVisible( false )
6. setState
(new Waiting())
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
User :AreaConnectionHyperlink :EncounterCast :Waiting
1. hit :RPGMouse :EncounterEnvironment
area
EventListener
connection
hyperlink :EncounterGame
2. mouseClicked()
3. handleEvent()
4. handleEvent()
5. setVisible( false )
6. displayArea()
7. displayPlayerCharacter()
Characters
«framework package»
GameCharacter
EncounterCharacters
«application package»
EncounterCharacter
PlayerCharacter
«facade»
EncounterCast
ForeignCharacter
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.
EncounterEnvironment Package
GameEnvironment
GameArea GameCharacter
GameAreaConnection
....
EncounterEnvironment Package
GameEnvironment
GameArea GameCharacter
GameAreaConnection
Area
EncounterAreaConnection
EncounterEnvironment ConnectionHyperlink
EncounterEnvironment
Adapted from Software Engineering: An Object-Oriented Perspective by Eric J. Braude (Wiley 2001), with permission.