Object Oriented Software Construction - Bertrand Meyer
1370 pág.

Object Oriented Software Construction - Bertrand Meyer


DisciplinaProgramação Orientada A Objetos3.319 materiais50.737 seguidores
Pré-visualização50 páginas
Object-Oriented
Software
Construction
SECOND EDITION
Bertrand Meyer
ISE Inc.
Santa Barbara (California)
Author\u2019s address:
Bertrand Meyer
Interactive Software Engineering Inc. (ISE)
270 Storke Road, Suite 7
Santa Barbara, CA 93117
USA
805-685-1006, fax 805-685-6869
<meyer
@tools.com>, http://www.tools.com
Preface
B orn in th
aberration of
explanation) 
typhoon, by 
hitting the sh
\u201cObject
\u201cstructured\u201d 
is used by dif
three-step seq
principle: (1)
(The order m
Let us h
approach to h
not trivial (al
believe it is n
techniques th
many softwa
potential for 
Finally, I hop
excitement ab
\u201cAvenu
oriented meth
the methods
environments
applying object-oriented principles to such areas as exploratory programming and
artificial intelligence. Although the presentation does not exclude these applications, they
are not its main emphasis. Our principal goal in this discussion is to study how practicing
software developers, in industrial as well as academic environments, can use object
technology to improve (in some cases dramatically) the quality of the software they
produce.
e ice-blue waters of the festooned Norwegian coast; amplified (by an
 world currents, for which marine geographers have yet to find a suitable
along the much grayer range of the Californian Pacific; viewed by some as a
some as a tsunami, and by some as a storm in a teacup \u2014 a tidal wave is
ores of the computing world. 
-oriented\u201d is the latest in term, complementing and in many cases replacing
as the high-tech version of \u201cgood\u201d. As is inevitable in such a case, the term
ferent people with different meanings; just as inevitable is the well-known
uence of reactions that meets the introduction of a new methodological
 \u201cit\u2019s trivial\u201d; (2) \u201cit cannot work\u201d; (3) \u201cthat\u2019s how I did it all along anyway\u201d.
ay vary.) 
ave this clear right away, lest the reader think the author takes a half-hearted
is topic: I do not see the object-oriented method as a mere fad; I think it is
though I shall strive to make it as limpid as I can); I know it works; and I
ot only different from but even, to a certain extent, incompatible with the
at most people still use today \u2014 including some of the principles taught in
re engineering textbooks. I further believe that object technology holds the
fundamental changes in the software industry, and that it is here to stay.
e that as the reader progresses through these pages, he will share some of my
out this promising avenue to software analysis, design and implementation. 
e to software analysis, design and implementation\u201d. To present the object-
od, this books resolutely takes the viewpoint of software engineering \u2014 of
, tools and techniques for developing quality software in production
. This is not the only possible perspective, as there has also been interest in
PREFACEvi
Structure, reliability, epistemology and classification
Object technology is at its core the combination of four ideas: a structuring method, a
reliability discipline, an epistemological principle and a classification technique. 
The str
systems perfo
systems, it is
resulting con
which in obje
structure and
The reli
that does wh
components w
defining expl
The epi
classes. In ob
can do with 
operations (th
types, covere
going beyond
\u201cobject\u201d borr
systems mod
it; for the obj
exist indepen
not is an irre
something is 
The cl
intellectual w
taxonomies f
oriented meth
Simple bu
The four con
a number of q
manipulate c
are the possib
that may exis
engineering c
Answer
producing re
binding; a 
s 
e 
te-
ucturing method applies to software decomposition and reuse. Software
rm certain actions on objects of certain types; to obtain flexible and reusable
 better to base their structure on the object types than on the actions. The
cept is a remarkably powerful and versatile mechanism called the class,
ct-oriented software construction serves as the basis for both the modular
 the type system. 
ability discipline is a radical approach to the problem of building software
at it is supposed to do. The idea is to treat any system as a collection of
hich collaborate the way successful businesses do: by adhering to contracts
icitly the obligations and benefits incumbent on each party.
stemological principle addresses the question of how we should describe the
ject technology, the objects described by a class are only defined by what we
them: operations (also known as features) and formal properties of these
e contracts). This idea is formally expressed by the theory of abstract data
d in detail in a chapter of this book. It has far-reaching implications, some
 software, and explains why we must not stop at the naïve concept of
owed from the ordinary meaning of that word. The tradition of information
eling usually assumes an \u201cexternal reality\u201d that predates any program using
ect-oriented developer, such a notion is meaningless, as the reality does not
dently of what you want to do with it. (More precisely whether it exists or
levant question, as we only know what we can use, and what we know of
defined entirely by how we can use it.) 
assification technique follows from the observation that systematic
ork in general and scientific reasoning in particular require devising
or the domains being studied. Software is no exception, and the object-
od relies heavily on a classification discipline known as inheritance.
t powerful
cepts of class, contract, abstract data type and inheritance immediately raise
uestions. How do we find and describe classes? How should our programs
lasses and the corresponding objects (the instances of these classes)? What
le relations between classes? How can we capitalize on the commonalities
t between various classes? How do these ideas relate to such key software
oncerns as extendibility, ease of use and efficiency? 
s to these questions rely on a small but powerful array of techniques for
usable, extendible and reliable software: polymorphism and dynamic
new view of types and type checking; genericity, constrained and
Abstract data type
are discussed in 
chapter 6, which 
also addresses som
of the related epis
mological issues. 
PREFACE vii
unconstrained; information hiding; assertions; safe exception handling; automatic garbage
collection. Efficient implementation techniques have been developed which permit
applying these ideas successfully to both small and large projects under the tight
constraints of commercial software development. Object-oriented techniques have also
had a conside
possible to pr
important ide
immediately a
Organizat
In the pages 
software cons
Part A i
of software q
characteristic
object-oriente
Part B i
describe the m
modularity: w
construction. 
object techno
inclined read
provides the 
principles and
Part C is
components o
management 
inheritance, t
many exciting
Part D 
Through seve
covers such c
and how to 
intellectual re
review of th
discussion of
Part E
development 
databases; the
Chapters 1 to 2.
Chapters 3 to 6.
Chapters 7 to 18.
Chapters 19 to 29.
Chapters 30 to 32.
rable impact on user interfaces and development environments, making it
oduce much better interactive systems than was possible before. All these
as will be studied in detail, so as to equip the reader with tools that are
pplicable to a wide range of problems. 
ion of the text
that follow we will review the methods and techniques of object-oriented
truction. The presentation has been divided into six parts. 
s an introduction and overview. It starts by exploring the fundamental issue
uality and continues with a brief survey of the method\u2019s main technical
s. This part is almost a little book by itself, providing a first view of the
d approach for hurried readers. 
s not hurried. Entitled \u201cThe road to object orientation\u201d,