Chap 6 - Software Reuse
Chap 6 - Software Reuse
Objectives
To explain the benefits of software reuse and
Topics covered
The reuse landscape
Design patterns
Generator based reuse
Application frameworks
Application system reuse
Software reuse
Software reuse is the process of creating software systems
Reuse benefits 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.
Reuse benefits 2
Standards compliance
Accelerated development
Reuse problems
Concept reuse
When you reuse program or design components, you
Introduction to Patterns
A pattern is the outline of a reusable solution to a
Introduction to Patterns
History
Design patterns
A design pattern is a way of reusing abstract knowledge
Pattern elements
Name
A meaningful pattern identifier.
Problem description.
Solution description.
Not a concrete design but a template for a design solution that can be
instantiated in different ways.
Consequences
The results and trade-offs of applying the pattern.
Factory Method
Builder
Structural Patterns
Abstract Factory
Prototype
Singleton
Adapter
Decorator
Proxy
Bridge
Facade
Composite
Behavioral Patterns
Command
Mediator
Strategy
Template Method
Interpreter
Observer
Chain of Responsibility
Iterator
State
Visitor
Subject
Spreadsheet Data
Observer
Spreadsheet Formula
Bar Graph
Pie Char
Real-World Example
GeneralBroadcast
Observerstuningintothenotification
attaching/detaching subjects
Observer
Defines an interface for notifying the subjects of changes
with subject
Benefits to Observer
Minimal coupling between the Subject and the Observer
Can reuse subjects without reusing their observers and vice versa
Observers can be added without modifying the subject
All subject knows its list of observers
Subject does not need to know the concrete class of an observer,
just that each observer implements the update interface
Subject and observer can belong to different abstraction layers
Support for event broadcasting
Subject sends notification to all subscribed observers
Observers can be added/removed at any time
The
The facade
facade pattern
pattern eases
eases
interaction
interaction between
between aa client
client and
and
aa sub-system
sub-system of
of suppliers
suppliers by
by
providing
providing aa simpler
simpler interface
interface to
to
the
the sub-system.
sub-system.
Analogy: a travel agent
If the faade mediates all interaction with a client, then the sub-system
the Store interface. Lets have a look at the code for one of
the stores.
the client.
AMP of input.
product
Benefits of SPL
Improve productivity
Increase quality
Decrease cost
Decrease labor needs
Decrease time to market (to field, to launch)
Ability to move into new markets in months, not years
Key points
Advantages of reuse are lower costs, faster software
Key points
COTS product reuse is concerned with the reuse of large,
off-the-shelf systems.
Problems with COTS reuse include lack of control over
functionality, performance, and evolution and problems with
inter-operation.
ERP systems are created by configuring a generic system
with information about a customers business.
Software product lines are related applications developed
around a common core of shared functionality.