0% found this document useful (0 votes)
97 views

Object Oriented Software Construction

Uploaded by

pouria
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Object Oriented Software Construction

Uploaded by

pouria
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

88 Book reviews

stack type is accompanied by a change to the abstract view of the procedures


associated with the type. Overall, the book would have benefited from a more
systematic way of moving from abstract data types to program components.
The book is written in a readable style and contains plenty of examples, diagrams
and exercises, especially in the early chapters (like many data structures books, it
does not show the reader how to implement the more advanced ways of organising
external files in its chosen programming language).
The book can be recommended as a supporting text for an introductory data
structures course which sets out to give students a first taste of data abstraction and
which uses Pascal for the practical work.
R.J. MITCHELL
Information Technology Research Institute
Brighton Polytechnic
Brighton, United Kingdom

Object-Oriented Software Construction. By Bertrand Meyer. Prentice-Hall, Hemel


Hempstead, United Kingdom, 1988, Price X19.95, ISBN 0-13-629031-O.
Bertrand Meyer’s view on object-oriented programming, as expressed in this book,
is that it is an extremely useful tool for the systematic construction of high-quality
software. This is in sharp contrast with the, apparently prevailing, view that object-
oriented programming is best suited for rapid prototyping, where the speed of
creating new applications and modifying existing ones is considered much more
important than the quality of the resulting software. It is quite clear that these
different approaches require different tools and techniques.
The first part of the book introduces the main aspects of software quality (correct-
ness, robustness, extendibility, reusability, and compatibility) and indicates in broad
terms how object-oriented programming and design can help to achieve these goals.
Object-oriented design is contrasted with top-down functional design and it is
explained why the latter is not very suitable for producing reusable and extendible
software.
In the second and largest part, object-oriented programming is presented in more
detail. The basic notions of objects, classes, fields (called instance variables in
Smalltalk), routines (often called methods), and inheritance are carefully explained
and illustrated with many programming examples. The question of how to design
systems in an object-oriented way is given much attention. The programming notation
used is the language Eiffel, which the author has designed himself. In this way, the
book becomes an introduction to Eiffel as well as to object-oriented programming
in general.
Part three of the book discusses how to apply these object-oriented techniques
in environments different from Eiffel. The general conclusion here is that this cannot
be recommended. Languages like Pascal and C do not provide the required informa-
tion hiding facilities. Ada and Modula-2 provide mechanisms for modularity but
Book reviews 89

not for late binding. Finally, most existing object-oriented languages are more
directed towards rapid prototyping and lack reliability-enhancing concepts like
strong typing.
The programming language Eiffel was specifically designed for programming and
design in the style the author advocates. It comprises notions common to most
object-oriented languages, such as objects, classes, and (multiple) inheritance. The
special things in Eiffel are the strong typing mechanism and the use of assertions.
Strong typing (present in very few object-oriented languages) enables the compiler
to determine statically whether the result of an expression admits a certain operation,
but the actual code executed can still vary at run-time, depending on the specific
object that the expression delivers (this phenomenon is called late binding).
Assertions, in the form of boolean expressions, enable, the programmer to state
some properties of the system at a certain point in its execution. They can be used
as pre- and postconditions of routines, as class or loop invariants, or simply in
check instructions at arbitrary points in the code. Optionally they can be checked
at run-time (in order to achieve this, the expressive power of assertions had to be
restricted: quantification, for example, is not allowed). An interesting experimental
mechanism for exception handling has been based on this use of assertions. However,
in my opinion, this mechanism is not yet sufficiently mature. I also regret that the
assertions are not embedded in a formal system for program verification (although
I know very well how difficult it is to develop such a system).
Another concept that is not yet understood well enough is inheritance. In Eiffel
there are precise rules about the relationship between a parent class (‘superclass’)
and a descendant (‘subclass’). For example, the class invariant of the parent class
must be maintained by the descendant, and if a routine is redefined its precondition
in the parent class must imply the precondition in the descendant and the postcondi-
tion in the descendant must imply the postcondition in the parent class. All this
serves to ensure that whenever an instance of the parent class is expected, an instance
of the descendant can be used without problems. Therefore it is strange that Eiffel
does not enforce the well-known contravariant parameter type rule: if the parent
class a routine has a parameter of type 7, then in each descendant where the routine
is redefined, its parameter type should contain (be a super-type of) the type T. In
Eiffel, on the other hand it is required that the parameter type of the redefined
routine is a subtype of the original one. While this seems plausible, it can lead to
type errors.
Furthermore, in Eiffel as in all other strongly typed object-oriented languages I
know of, inheriting code from a class is necessarily connected with being a zyxwvutsrqponmlk
subt y pe

of that class. This means that whenever an element of the parent class is expected,
the type system also allows an instance of a descendant class to be used. Recently
it has been recognized that several problems with (multiple) inheritance can be
solved elegantly by decoupling these two hierarchies, the inheritance hierarchy
dealing with the internal implementations of the objects on the one hand, and the
type hierarchy dealing with their external interface on the other hand.
90 Book reviews

Despite these points of criticism, I still think that Eiffel is an excellent tool (if
not the best currently available one) for the purpose for which it was designed:
systematic development of reliable, reusable software.
Also, I really like the style of programming advocated in this book. It shows,
rather convincingly, that object-oriented programming and design, practiced in a
disciplined way, offer a definitely better alternative to traditional programming and
design techniques. Especially the reusability of software components can be drasti-
cally improved. It also shows that object-oriented programming is not just suitable
for rapid prototyping, but that it can be used advantageously for the development
of reliable (and efficient!) software products, provided the right tools and techniques
are used.
The book presents the concepts in an orderly manner and explains them very
well. It is certainly not just a book on Eiffel programming, and not even just a book
on object-oriented programming. It is even more attractive because it presents a
technique of object-oriented zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIH
design and explains why this technique is in many
cases superior to the traditional ones. At the technical level, the book contains an
extensive index and an adequate bibliography. There are only few printing errors
(of which surprisingly many occur in the figures). The paperback edition is reason-
ably priced. All in all, I can recommend this book to everyone who is interested in
object-oriented design and programming, and its first part even to anyone who is
not (yet) interested.

Pierre AMERICA
Philip Research Laboratories
Eindhoven, Netherlands

Algorithm Animation. By Marc H. Brown. MIT Press, London, 1988, Price L26.95
(hardback), ISBN o-262-02278-8.

“A picture is worth a thousand words, a movie even more. But an interactive


movie. . .” Marc H. Brown’s BALSA is an environment for setting up and running
interactive animations of algorithms. “An algorithm animation environment is an
‘exploratorium’ for investigating the dynamic behaviour of programs, one that makes
possible a fundamental improvement in the way we understand and think about
them. It presents multiple graphical displays of an algorithm in action, exposing
properties of the program that might otherwise be difficult to understand or might
even remain unnoticed.” Getting a mental grip on an algorithm and all its
ramifications-whether you are inventing a new one or learning about an old
one-can be a slow and unreliable business if you’ve only got a wordy description
to go on, formal or not. Even with a few pictures, explaining at a blackboard the
relative virtues of different bin-packing algorithms is liable to leave some of the
audience behind. But if it’s true that most of us build mental pictures to understand

You might also like