Object-Oriented Programming in Oberon-2

Categories:

Recommended

Object-oriented programming (OOP) has become a buzzword that is prominently displayed in numerous journals and advertisements. What is OOP all about? Is it merely a marketing fad, or does it really denote something new and useful, perhaps even a new panacea?

To be short, OOP is no panacea. Contrary to the claims made by some vendors, it does not make programming a trivial task. OOP requires a sizable portion of ability and experience—perhaps even more than traditional programming techniques do. However, OOP definitely has its strengths: it often permits more elegant solutions than are possible with conventional techniques; it promotes modularity and thus readability and maintainability of programs; and it contributes to the extensibility and reusability of software.

This book is aimed at students of computer science as well as at practitioners who want to gain a perspective on new software development methods. Since more and more languages are being extended to include object-oriented features, this book also addresses programmers who want to make better use of these new features.

The goal of this book is to convey the fundamentals of OOP, namely classes, inheritance and dynamic binding. The emphasis is on the concepts rather than on the specifics of a particular programming language. In addition, readers should learn to determine for which problems OOP is most suitable, and which problems would be better solved with conventional means.

Object-oriented programming is programming in the large. Although its principles can be explained on the basis of small examples, wider reaching examples are necessary in order to convey the power and elegance of this technique. This is precisely what is missing in most books on the subject. Chapter 11 thus presents the design and implementation of an adequately large system, including source code, in order to drive home the ideas behind object-oriented programming.

The examples in this book are not coded in any of the widespread languages such as Smalltalk or C++. Instead, Oberon-2, a language in the tradition of Pascal and Modula-2, was selected. The reason for this choice is that Oberon-2 is more compact than most of the other object-oriented languages; in fact, it is even smaller than Pascal, which makes it possible to master the language quickly. Object-oriented elements are smoothly integrated into the language without displacing proven constructs such as records, arrays and procedures. Once the reader has understood the concepts presented in this book, it should be easy to transfer them to any other language.

However, if the reader takes a liking to Oberon-2, the Oberon System, complete with compiler, editor and several other tools, can be obtained at no charge. Implementations are available for several platforms (see Appendix D). The case study printed in Chapter 11 is also available as source code.

The Oberon System was developed by Professors Niklaus Wirth and Jürg Gutknecht 1985-1987 at ETH Zürich [WiG92]. It consists not only of the Oberon language, but also of an operating system with the same name. The design of Oberon reflects the experience of the man who developed Algol W, Pascal and Modula-2. In Oberon-2, the author of this book added several extensions to the Oberon language that make it more suitable for object-oriented programming.

This book is neither a general introduction to programming nor a handbook for Oberon-2; these tasks are covered by other texts [ReW92, Rei91]. The reader is assumed to be familiar with an imperative language such as Pascal or Modula-2. Chapter 2 explains Oberon-2 only enough to enable comprehension of the examples in this book. Appendix A contains the complete language definition.

Category:

Attribution

Hanspeter Mössenböck. Object-Oriented Programming in Oberon-2. http://ssw.jku.at/Research/Books/Oberon2.pdf

VP Flipbook Maker

Convert your work to digital flipbook with VP Online Flipbook Maker! You can also create a new one with the tool. Try it now!