Page 211 -
P. 211
194 Chapter 7 Design and implementation
software was the reuse of functions and objects in programming language libraries.
However, costs and schedule pressure meant that this approach became increasingly
unviable, especially for commercial and Internet-based systems. Consequently, an
approach to development based around the reuse of existing software emerged and is
now generally used for business systems, scientific software, and, increasingly, in
embedded systems engineering.
Software reuse is possible at a number of different levels:
1. The abstraction level At this level, you don’t reuse software directly but rather
use knowledge of successful abstractions in the design of your software. Design
patterns and architectural patterns (covered in Chapter 6) are ways of represent-
ing abstract knowledge for reuse.
2. The object level At this level, you directly reuse objects from a library rather
than writing the code yourself. To implement this type of reuse, you have to find
appropriate libraries and discover if the objects and methods offer the function-
ality that you need. For example, if you need to process mail messages in a Java
program, you may use objects and methods from a JavaMail library.
3. The component level Components are collections of objects and object classes
that operate together to provide related functions and services. You often have to
adapt and extend the component by adding some code of your own. An example
of component-level reuse is where you build your user interface using a frame-
work. This is a set of general object classes that implement event handling, dis-
play management, etc. You add connections to the data to be displayed and
write code to define specific display details such as screen layout and colors.
4. The system level At this level, you reuse entire application systems. This usually
involves some kind of configuration of these systems. This may be done by
adding and modifying code (if you are reusing a software product line) or by
using the system’s own configuration interface. Most commercial systems are
now built in this way where generic COTS (commercial off-the-shelf) systems
are adapted and reused. Sometimes this approach may involve reusing several
different systems and integrating these to create a new system.
By reusing existing software, you can develop new systems more quickly, with
fewer development risks and also lower costs. As the reused software has been tested
in other applications, it should be more reliable than new software. However, there
are costs associated with reuse:
1. The costs of the time spent in looking for software to reuse and assessing
whether or not it meets your needs. You may have to test the software to make
sure that it will work in your environment, especially if this is different from its
development environment.
2. Where applicable, the costs of buying the reusable software. For large off-the-
shelf systems, these costs can be very high.