---- 1. What role does reuse play in the architecture of new software
Software reuse is one central strategy to increase productivity and
decrease maintenance time. Both help to cut down development costs --
and effectively make the software company more competitive. In short,
software reuse prevents the programmer from having to "reinvent the
wheel" every time a similar task needs to be implemented again.
Software reuse is closely connected to the principle of OOP (Object
Oriented Programming), modularization, and refactoring. This means
code is written in small portions, each of them with a single and
clearly defined task to solve. If this task comes up again, the
function, object, or module does not need be rewritten; instead, the
so-called "code snippet" (or Object, module, "code library") is simply
copied & pasted, or referenced.
One other major advantage is that when reusing older components, they
are likely already tested and debugged over a long period of time and
therefore relatively stable. On the other hand, if one re-implements a
task, the code may contain bugs which are not yet discovered. And
testing will always delay product schedule.
Software reuse does not only take place at the lower code level;
design strategies on the higher software architecture level can be
reused in a new project as well.
Software Reuse: Because the Waters are Rising (by Eric Aranow, Context
"Software engineering is analogous to manufacturing, where one can
make the distinction between the patience to invest in a factory as
opposed to only in pieces of machinery. The rationale for making the
long-term investment in a factory is that the long-range payoff will
be far greater than the near-term costs. Imagine where the auto
industry would be today if it had never invested in factories! This is
where software producers are today without software reuse.
This analogy to factories is remarkably appropriate to software reuse.
It takes discipline to design a car model from the components the auto
factories are geared up to produce or use. This is nearly identical to
the discipline required for designing software that utilizes reusable
assets. Similarly the planning required to design a frame, a
transmission, or an engine such that it can be used in multiple auto
models is very closely related to the planning for reusable software
assets, just as the planning to design a factory line such that it can
produce parts for multiple car models."
---- 2. What are the potential risks and disadvantages when reusing
First of all, there are difficulties in software reuse. If one builds
up a library of code, not only will one have to maintain it, add to
it, prepare code for it; one also must effectively find the code and
know when to look for it. Sometimes, programming smaller
functionalities from scratch can be faster than locating them, since
finding "just the right" function is not trivial (and often
impossible, since the function may not exist). In other words, at
times the delay in finding the wheel is bigger than reinventing it.
Another potential disadvantage of reusing components is they might not
be optimized enough for the current project. If a component is
reusable it must also be written in a generalized way, which might not
be the optimum approach for the task at hand. This inappropriate reuse
of components may even result in the whole project taking a shift in
the wrong direction, since other new components now have to be adapted
to "imperfections" of the old one. (Imperfections in the context of
the new system architecture.)
Also, the older component that is about to be reused may not have been
written by the current software engineer (or current team). Therefore
it takes additional time to analyze wether or not it's suited for the
current project, and to understand its inner working (object
relationships, data in- and output, method handling, terminology). One
might have to create "glue logic", methods that do nothing but handle
the connection from old to new code. And the maintenance of this
reused component whenever a problem occurs in the future is much more
costly, since any programmer can tell it takes longer to understand,
debug, and refactor someone else's source code.
There is also one non-technical disadvantage in reusing components, in
that it might reduce the likelihood of new, improved strategies being
invented by a creative programmer.
Please see the following paper for more information:
The Benefits and Difficulties of Software Reuse [Word Document]
I hope it helps!
"software reuse" benefits