Reuse 1
Reuse 1
Increased dependability Reused software, that has been tried and tested in working systems,
should be m ore dependable than new software. The initial use of the
software reveals any design and implementation faults. These are then
fixed, thus reducing the number of failures when the software is reused.
Reduced process risk If software exists, there is less uncertainty in the costs of reusing that
software than in the costs of development. This is an important factor
for project management as it reduces the margin of error in project cost
estimation. This is particularly true when relatively large software
components such as sub-systems are reused.
Effective use of specialists Instead of application specialists doing the same work on different
projects, these specialists can develop reusable software that
encapsulate their knowledge.
Creating and maintaining a Populating a reusable component library and ensuring the software
component library developers can use this library can be expensive. Our current techniques
for classifying, cataloguing and retrieving software components are
immature.
Finding, understanding and Software components have to be discovered in a library, understood and,
adapting reusable components sometimes, adapted to work in a n ew environment. Engineers must be
reasonably confident of finding a component in the library before they will
make routinely include a component search as part of their normal
development process.
CompoC
OT
develop
inteS
Pr
ra
rati
Legac
wrapp
Con ge
tica
appl
Servic
system
Prog
ram
libra
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 18 Slide 10
Reuse approaches 1
Sub
Obser
A:
B:
5
C:
D:
0 Ob4
2
1
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 18 Slide 17
The Observer pattern
Name
• Observer.
Description
• Separates the display of object state from the object itself.
Problem description
• Used when multiple displays of state are needed.
Solution description
• See slide with UML description.
Consequences
• Optimisations to enhance display performance are
impractical.
Upd
Detach
for
Notify
o all
-> (
()
Conc
Concrete
ob
return
Upd
GetState
subjectS
obse s
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 18 Slide 19
Generator-based reuse
Program generators involve the reuse of
standard patterns and algorithms.
These are embedded in the generator and
parameterised by user commands. A program
is then automatically generated.
Generator-based reuse is possible when
domain abstractions and their mapping to
executable code can be identified.
A domain specific language is used to
compose and control these abstractions.
pkno
tion
plic
wledDa
ta
ba
©Ian Sommerville 2004 Software Engineering, 7th edition. Chapter 18 Slide 22
Key points
Advantages of reuse are lower costs, faster
software development and lower risks.
Design patterns are high-level abstractions
that document successful design solutions.
Program generators are also concerned with
software reuse - the reusable concepts are
embedded in a generator system.