Software reuse

From CSSEMediaWiki
Revision as of 04:00, 5 August 2008 by Warwick Irwin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The idea of software reuse has hugely influenced the thinking of the OOD community. Many OOD principles were first developed as an aid to reuse.

Reuse is now unfashionable, because it has proven harder to achieve than everybody expected. But the principles still matter. In fact, some people now argue that designing reusable code is just the same as designing good code.

Martin Fowler 1997 (p. 11) gives a simple overview:

"If the average professional is asked what the principal benefit of object technology is, the answer is almost always reuse.  The vision is that of developers being able to assemble systems from tried and tested off-the-shelf components.  Many of these visions have been very slow to appear.  In some cases reuse is beginning to show, most notably in GUI development and database interaction.  Where they are not appearing is at the business level."

Johnson and Foote 1988 is a very important early paper on OO. Among other things, it provides insight into the reuse mindset.

Granularity of reuse

Arthur Riel 1996, p. 8, makes an interesting observation about reuse. He says reuse is supported by OO (in part) because classes have the right granularity: somewhere between statements/functions and applications:

"The term software reuse has become a major buzzword in the object-oriented community.  Why all the excitement with reusing software in the object-oriented world?  We have always had software reuse.  How many developers have used an `if` statement in their favorite programming language?  How many C programmers have used `printf()`?  How many Pascal programmers have used `writeln()`?  Why the renewed discussion on software reusability?  As it turns out, there is an inverse proportion between the size (or granularity) of the code we reuse and its flexibility.  `If` statements are very small and very flexible, while Lotus 1-2-3 [a spreadsheet] is a much larger level of reuse, but it has a specific purpose.  It is thought that the types of constructs found in the object-oriented paradigm find a happy medium between the granularity of the software and its flexibility."

He goes on to note that the theory has not delivered as much as hoped:

"Unfortunately, the level of software reuse achieved in object-oriented applications has been disappointing for many developers."

See also

Personal tools