OOSC2
A full online version of
Object-Oriented Software Construction,
2nd edition (1997)
To read this second edition, you will find the full PDF (11 MB) here.
The second edition of Object-Oriented Software Construction was published in 1997, considerably augmented from the 1988 first edition. For more about the book, see the Wikipedia entry about it.
Both editions were published by Prentice Hall, now part of Pearson Education, Inc. With Pearson’s kind permission, this online version has been made available in response to frequent requests and in preparation of the forthcoming third edition.
This version is the original text from the 1997 edition. The contents and pagination remain essentially the same. Substantial changes will appear in the forthcoming third edition.
(December 2022 note: as a qualification to the preceding observation, to avoid perpetuating obsolete syntax I did now make a few changes: removing the “is” of feature declarations, getting rid of the “!!” for creation, replacing “indexing” by “note” etc. The table of contents, list of principles and index have all been regenerated and are up to date.)
To follow the progress of the third edition, please consult bertrandmeyer.com/OOSC3.
Copyright notice: The text is not in the public domain. It is copyrighted material, made available free of charge on the Web for the convenience of readers, in particular for use as a textbook in courses. You are not permitted to copy it or redistribute it. Please refer others to the present version at bertrandmeyer.com/OOSC2.
A number of pirated versions have found their way to various sites on the Web. They are illegal (and typically of bad typographical quality). If you encounter such a version, please ask the site owners to remove it, or notify the author. You can also simply use the comment section for this page.
The link again: you can download the text (11 MB) from here.
(Please do not bookmark or share this download link as it may change, but use the present page: https://bertrandmeyer.com/OOSC2.)
I downloaded the PDF. It has one foible I’ve come across. Wherever the word “purpose” occurs it seems to be preceded by “ee-“, as “ee-purpose”. But the book is great. Thanks for all you do.
Thank you very much for pointing this out. It’s a text processing error (a script that overreached its goal) which I thought I had corrected. There were actually over 200 cases of the spurious “ee-“, not just in connection with “purpose”, so it imposed a non-trivial impediment on the reader. I have fixed it now — at least I hope I caught all occurrences. Please re-download and accept my apologies.
I downloaded the pdf from the above link. On page 186, under “Qualified and unqualified calls” section, the dot (“.”) seems to be replaced by very small subscript version of ?. I am not sure if it is text processing error or not. I tried a few pdf readers including Adobe Acrobat Reader. I am seeing the same thing in all readers. Since I can’t attach pictures here, I copied the text and pasted below:
It was said above that all object-oriented computation relies on feature calls. A consequence of this rule is that software texts actually contain more calls than meet the eye at first. The calls seen so far were of one of the two forms introduced above:
x? f
x?f (u, v, )
Such calls use so-called dot notation (with the “ ? ” symbol) and are said to be qualified because the target of the call is explicitly identified: it is the entity or expression (x in both cases above) that appears before the dot.
I see it. In fact it’s a special format that should give a big dot. It seems to appear throughout. I will fix it — give me a couple of days. Thanks for reporting the problem.
Thanks for your kindness.
On page 183, I found one minor glitch. According to below, I suppose, in the class GRAPHICS,
`p1? translate (4.0, –1.5) –??` should be `p1? translate (4.0, –1.5) –**`.
For the dot problem, I’ve reported above. But asterisks changed to question marks as well. I am afraid this happens for actual code, not in the comment.
Feature call
The starred instruction,
p1? translate (4.0, –1.5)
Hello,
I am afraid to ask, but I’d like to know if the above problem has been fixed in the pdf book.
One of my friend help me get a used printed version from amazon, but shipping the book from US to my country will take a while, probably more than one month.
Best regards
Yes, it has been fixed now. Finished today in fact. Thank you very much for reporting the problem.
I used the opportunity to do some more cleanup. Somehow the paging had become wrong (because of minute differences — sometimes at level of a 10th of a point or millimeter) between original (Unix) fonts and current ones. Also, I updated some syntactical elements to use the modern versions: no more !! for creation, note instead of indexing, no more “is” in the declaration of features… All this took some time. (After all it’s over 1200 pages.) I do not guarantee that the result is bug-free but there shouldn’t be any major problem of the “big dot” kind. Of course any more in-depth change will be for the 3rd edition.
Let me know (in this page) if you find more problematic stuff.
Sure. Thank you very much.
I will be reading many parts of the book in coming months, and I’ll do update you whichever typesetting error I found along the way so that they can be fixed when you have time.
I can imagine how difficult it can be, after 25 years, to reproduce a book exactly as it was. Only if the exact same environment (the operating system, the fonts, the exact version of the typesetting software used) on which the book was created can be emulated, we may be able to recreate it perfectly the same.
Hello,
Here are just a few glitches I encountered so far. They are just minor and not so problematic, but just in case you may want to know…
On page 693, air_reservation.enter_transition (sn, tn, l) should be air_reservation.put_transition (sn, tn, l) so that the feature name matches with the definition on the facing page
On page 428, in the figure, create a.make(…) is covering the S1 a little bit
On page 777, in the class LINKED_LIST1 [G], I guess count:G should be count:Integer.
On page 699, you may want to remove `is` from the deferred class (I am not too sure though)
deferred class COMMAND feature
execute is deferred end
undo is deferred end
end
On page 691, STATE of in the comment is wrapped to the next line. I am not sure all such cases can be eliminated. But it makes me think STATE is part of the class definition, not a comment.
— This refers of course to the execute procedure of STATE
On page 364 (section 11.8 Class Invariants), the bad dot is there again throughout the page, but this time it appears as a small “1” .
I found many more in fact. I hope to have fixed all of them. (So far in my version, processing the other comments before updating the PDF.)
There is also what seems to be a multiplication symbol looking just like the lower dot for member access. Here is a snippet of both from page 177:
Result := sqrt ((x – px) ^ 2 + (y – p y) ^ 2)
end
translate (a, b: REAL)
— Move by a horizontally, b vertically.
do
x := x + a
y := y + b
end
scale (factor: REAL)
— Scale by factor.
do
x := factor x
y := factor y
Thanks. I hadn’t noticed it yet. I will fix it as soon as possible, I hope this week-end (but maybe only the next one).
Fixed but it’s the only one I saw, I hope there no others.
I have corrected all the errors reported above and some others in the same vein. Thanks for reporting them. Please re-download the file.
Here’s one more that seems to be a multiplication symbol, on page 171:
As an example of inheritance, classes INTEGER, REAL and DOUBLE will be heirs to more general classes: NUMERIC, introducing the basic arithmetic operations such as “+”, “–”and “”,
I’ve now noticed more of these, several on page 190.
Are you sure you downloaded the latest version? I see no problem on page 190.
Do note that I didn’t just correct the occurrences you reported before, I searched for similar patterns and found quite a few more that I corrected. Please make sure you re-download.
Unless I am missing something of course.
I downloaded again and it matches exactly what I had. I wonder if the pagination is different. I’m using Adobe Acrobat Reader to read it. Here is what I see on p. 190 (doesn’t paste well here):
190 THE STATIC STRUCTURE: CLASSES §7.7
As a consequence of the second property, operator features only support qualified calls. If a routine of class REAL contained, in the first version given earlier, an unqualified call of the form plus (y), yielding the sum of the current number and y, the corresponding call will have to be written Current + y in the second version. With an identifier feature, the corresponding notation, Currentplus (y), is possible but we would not normally use it in practice since it is uselessly wordy. With an operator feature we do not have a choice.
Other than the two syntactical differences noted, operator features are fully equivalent to identifier features; for example they are inherited in the same way. Any class, not just the basic classes such as REAL, can use operator features; for example, it may be convenient in a class VECTOR to have a vector addition function called infix “+”.
The following rule will apply to the operators used in operator features. An operator is a sequence of one or more printable characters, containing no space or newline, and beginning with one of
+ – / = \ ^ @ # | &
In addition, the following keywords, used for compatibility with usual boolean notation, are permitted as operators:
not and or xor and then or else implies
In the non-keyword case, the reason for restricting the first character is to preserve the clarity of software texts by ensuring that any use of an infix or prefix operator is immediately recognizable as such from its first character.
Basic classes (INTEGER etc.) use the following, known as standard operators:
•Prefix: + – not.
•Infix: + – / = // \\ ^ and or xor and then or else implies.
The semantics is the usual one. // is used for integer division, \\ for integer remainder, ^as the power operation, xor as exclusive or. In class BOOLEAN, and then and or else are variants of and and or, the difference being explained in a later chapter, and implies is the implication operator, such that a implies b is the same as (not a) or else b.
Operators not in the “standard” list are called free operators. Here are two examples of possible operator features using free operators:
•When we later introduce an ARRAY class, we will use the operator feature infix “@”for the function that returns an array element given by its index, so that the i-th element of an array a may be written simply as a @ i.
•In class POINT, we could have used the name infix “|–|” instead of distance, so that the distance between p1 and p2 is written p1 |–| p2 instead of p1p2.
I am reading this and really enjoying it. Thanks for all you do.
I’ve taken a look at the reported problem on page 190 by @JSoftwareEngineer. Yah, the problem seems to be there.
Are you sure you re-downloaded from the above link? I don’t see anything wrong on page 190. (I assume you mean page 190 per the page numbers in the text, which is page 220 in the PDF; page 190 of the PDF has no special characters.)
From experience I assume you are right and I am missing something, but I don’t see it.
Sure, I always double check this comment to make sure I am getting the latest copy: “This version was produced from the original files on 27 October 2022 Updated 14 November 2022, 4 December 2022, 17 March 2023”. If you don’t mind, please check the following google drive shared folder:
https://drive.google.com/drive/folders/1pLkmR1VcUEuFt4q7YJETHg3gsXmF3swU?usp=sharing
I’ve highlighted what I’ve verified against pdf and printed copy.
I see, thanks. It was actually a consequence of a fix to the earlier problems, carried out too eagerly (to a case which had the same formatting, and hence was updated, but was actually correct).
Fixed now (I hope).
Thanks for the fixes. I guess we are quite close to the original printed version. I believe there are still around less than 35 asterisk(*) like characters replaced accidentally due to fixing the errors we reported earlier. I’ve already spotted a few.
What I am doing now is comparing the count of big dots (for member access) and asterisk (and asterisk like) characters in “CD ROM’s pdf” files and the pdf downloaded from this page. “CD ROM’s pdf” files do not seem to have all those problem above, although typographical quality is not quite good. So I think we can use it to check the counts.
CD ROM’s pdf
————-
Big dot (for member access) >>> 970
Actual asterisk >>> 88
Asterisk like type 1 (used for multiplication symbol) >>> 30
Asterisk like type 2 (used in deferred class figure >>> 61
PDF from this page
———————-
Big dot (for member access) >>> 1005 (35 more than the above, which I suppose are wrongly replaced asterisks)
Actual asterisk >>> 88
Asterisk like type 1 (used for multiplication symbol) >>> 0
Asterisk like type 2 (used in deferred class figure oval) >>> 64 result
According the counts above, I think we can assume all bad dots has been fixed (in fact fixed a few more than we should). And I suppose we’ve replaced 3 or 4 multiplication symbols (“Asterisk like type 1”) with “Asterisk like type 2”. That’s why we now have 64 of them. All of the remaining “Asterisk like type 1” possibly have been replaced by big dots accidentally. Some of them I’ve already spotted. Just need to find out where the remaining ones are.
If the above assumptions were correct and i can find where the wrong places are, I will share the screenshots highlighting the places.
Please check this folder at your convenience:
https://drive.google.com/drive/folders/1pLkmR1VcUEuFt4q7YJETHg3gsXmF3swU?usp=sharing
I’ve highlighted all multiplication symbols replaced by the big dot unintentionally.
By the way, I received the printed copy sent from US by my friend last month. But I still prefer reading the ebook version.
Thank you very much for this magnificent book. I wish I came across and read it years ago.
Very kind, thanks.
I have always referred to the pages printed in the text, not the PDF’s numbering. The problems are not blockers; the meaning has always been decipherable. It is one of the very best software books I’ve found. Again, thanks for all you do.
Hello. I understand that there is a Spanish translation of this book. I have read many good reviews from this book to learn about POO I would like to know if it is possible to obtain such a translation in digital format.
Sorry for the late reply. Here is the information on the Spanish edition:
Prentice Hall, 1998, 1232 pages, with CD-ROM.
ISBN: 84-8322-040-7
If your bookstore has any trouble finding this book, please contact us.
The CD-ROM includes an object-oriented development environment (ISE EiffelBench) and the full hyperlinked text of the English edition.
Traducción:
Miguel Katrib Mora, Universidad de La Habana
Rafael García Bermejo, Universidad de Salamanca
Salvador Sánchez, Universidad Pontificia de Salamanca
Revisión técnica:
Jesus Garcia Molina, Universidad de Murcia
Carmelo R. Fernández Rupérez, European Software Institute
Coordinación de la traducción y revisión técnica:
Luis Joyanes Aguilar, Universidad Pontificia de Salamanca
From the Preface to the Spanish edition by Luis Joyanes Aguilar:
El excelente e inmenso trabajo de Bertrand Meyer permitirá por un lado seguir formando buenos y numerosos profesionales informáticos y de computación y, por otro, formar a especialistas en las modernas tecnologias orientadas a objetos con un énfasis especial en las ideas clave de estos años y del siglo XXI: componentes y reutilización. [Esta] obra será la referencia obligatoria en construcción de software orientado a objetos de los años previos al tercer milenio y durante el tercer milenio…
OOSC-2, no sólo es un libro mágico, magnífico e imprescindible para aprender a construir software orientado a objetos, sino que su lectura conducirá al lector a conseguir la excelencia en el mundo del software.