Object-Oriented Software Engineering: The Design Workflow
Object-Oriented Software Engineering: The Design Workflow
1
CHAPTER 12 Slide 12.2
Object-Oriented
Software Engineering THE DESIGN
WORKFLOW
WCB/McGraw-Hill, 2008
Stephen R. Schach
[email protected]
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
1
Object-Oriented Design Steps Slide 12.7
Object-Oriented Design Steps (contd) Slide 12.8
z Assign each method, either to a class or to a client z Step 2. Perform the detailed design
that sends a message to an object of that class – Design each class in detail
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
2
Method EstimatedFundsForWeek.computeEstimatedFunds
Slide 12.13
Method Mortgage.totalWeeklyNetPayments Slide 12.14
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Figure 11.9 (again)
3
Detailed Class Diagram: Elevator Problem Slide 12.19
Detailed Design: Elevator Problem Slide 12.20
z Detailed design
of elevatorEventLoop
is constructed
from the
statechart
Figure 12.4
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Figure 12.5
Figure 12.6
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Figure 12.8
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Figure 12.7 Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
4
Assigning Methods to Classes: MSG Foundation (contd)
Slide 12.25
Detailed Design: MSG Foundation Slide 12.26
z Assigning the other methods is equally z Step 2. Perform the detailed design
straightforward
– See Appendix F z Determine what each method does
z Summary of the design workflow: z The idea of decomposing a large workflow into
– The analysis workflow artifacts are iterated and independent smaller workflows (packages) is
incremented until the programmers can utilize them carried forward to the design workflow
z Why the product is broken into subsystems: z The architecture of a software product includes
– The various components
– It is easier to implement a number of smaller – How they fit together
subsystems than one large system – The allocation of components to subsystems
– If the subsystems are independent, they can be z The task of designing the architecture is
implemented by programming teams working in parallel
specialized
» The software product as a whole can then be delivered sooner
– It is performed by a software architect
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
5
The Design Workflow (contd) Slide 12.31
The Design Workflow (contd) Slide 12.32
z The architect needs to make trade-offs z It is usually impossible to satisfy all the
– Every software product must satisfy its functional requirements, functional and nonfunctional, within
requirements (the use cases) the cost and time constraints
– It also must satisfy its nonfunctional requirements, – Some sort of compromises have to be made
including
» Portability, reliability, robustness, maintainability, and security
– It must do all these things within budget and time z The client has to
constraints – Relax some of the requirements;
– Increase the budget; and/or
– Move the delivery deadline
z The architect must assist the client by laying out
the trade-offs
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
6
12.8 Real-Time Design Techniques Slide 12.37
Real-Time Design Techniques (contd) Slide 12.38
z Difficulties associated with real-time systems z The major difficulty in the design of real-time
systems
– Inputs come from the real world – Determining whether the timing constraints are met by
» Software has no control over the timing of the inputs the design
– Problems of synchronization
» Race conditions
» Deadlock (deadly embrace)
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
z Most real-time design methods are extensions of z It is critical to check that the design artifacts
non-real-time methods to real-time incorporate all aspects of the analysis
– To handle analysis and design artifacts we therefore
need upperCASE tools
z We have limited experience in the use of any real-
time methods
z UpperCASE tools
– Are built around a data dictionary
z The state-of-the-art is not where we would like it to
– They incorporate a consistency checker, and
be
– Screen and report generators
– Management tools are sometimes included, for
» Estimating
» Planning
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Figure 12.9
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
7
12.10 Metrics for Design Slide 12.43
Metrics for Design (contd) Slide 12.44
z Measures of design quality z Metrics have been put forward for the object-
– Cohesion oriented paradigm
– Coupling – They have been challenged on both theoretical and
– Fault statistics experimental grounds
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
z The design team should not do too much z We need to “grow” great designers
– The detailed design should not become code
z Potential great designers must be
z The design team should not do too little – Identified,
– It is essential for the design team to produce a – Provided with a formal education,
complete detailed design – Apprenticed to great designers, and
– Allowed to interact with other designers
Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved. Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.