Assignment Document

Programming Smalltalk – Object-Orientation from the Beginning Johannes Brauer - An introduction to the principles of programming

Pages:

Preview:


  • "Johannes Brauer Programming Smalltalk –Object-Orientation fromthe Beginning An introduction to the principlesof programmingJohannesBrauer ProgrammingSmalltalk– Object-Orientation fromtheBeginning Anintroductiontotheprinciples ofprogrammingJohannes B..

Preview Container:


  • "Johannes Brauer Programming Smalltalk –Object-Orientation fromthe Beginning An introduction to the principlesof programmingJohannesBrauer ProgrammingSmalltalk– Object-Orientation fromtheBeginning Anintroductiontotheprinciples ofprogrammingJohannes Brauer NORDAKADEMIE, Hochschule der Wirtschaft Elmshorn, Germany 1st English edition (based on the 4th revised and expanded German original) The translation and production of this book was sponsored by Cincom Systems. ISBN 978-3-658-06822-6 ISBN 978-3-658-06823-3 (eBook) DOI 10.1007/978-3-658-06823-3 Library of Congress Control Number: 2015931398 Springer Vieweg © Springer Fachmedien Wiesbaden 2015 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the mate- rial is concerned, speci?cally the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on micro?lms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter de- veloped. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a speci?c statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made. Printed on acid-free paper Springer Fachmedien Wiesbaden GmbH is part of Springer Science+Business Media (www.springer.com)Foreword Smalltalk is an outstanding technology. It has been in the forefront of many innovations that have helped to advance the art of application software development such as GUIs with overlapping windows, the mouse, handheld devices, web applications, object-oriented programming, test-driven development and extreme programming, just to name a few. Smalltalk was at the core of a revolution to enable true personal computing. This revolu- tion would eventually lead to the creation of a generic device that would allow people to help solve their problems back in the late 1960s and 1970s, an era that knew only large centralised data centres. During this same timeframe, in 1968, Cincom Systems was founded with then revolu- tionary ideas of simplifying the complexity associated with developing business. We saw that Smalltalk was the next evolution in application development, and that we share the same philosophy with Smalltalk: to bring value to users by providing simple, yet pow- erful solutions. Consequently, we bought into this technology in the mid-1990s and have continued to invest in it ever since. Advanced application technology is nothing without advanced users. Cincom is con- vinced that good education is the foundation for a better future. To support this on a worldwide basis, we established the Cincom Smalltalk Academic Program that allows academic institutions to use Cincom Smalltalk as part of a teaching curriculum free of charge. One such institution is the German university “NORDAKADEMIE” where Pro- fessor Brauer teaches his students—in a practice-oriented way—how to write software. Professor Brauer had developed his own introductory course to object-oriented program- ming using Cincom Smalltalk, and he made the course publicly available through his Ger- man textbook “Grundkurs Smalltalk—Objektorientierung von Anfang an”. It was an honour for us to support Professor Brauer with the translation of his book to English. Now his excellent course is available to students and teachers all over the world, nicely complementing the Cincom Smalltalk Academic Program. We wish all readers a lot of fun and success with Smalltalk! Brian L. Bish, Managing Director, Cincom Smalltalk vPreface The origins of this book lie in supplementary material for a basic programming course that is offered in the ?rst two semesters of the commercial IT course of study at the NOR- DAKADEMIE Business School. Since the winter semester of 1999/2000, object-oriented programming has been taught using the Smalltalk programming language. It was always dif?cult to decide which text books to assign to students, because the many books that were available to teach object-oriented programming in general and Smalltalk in particular often presupposed at the very least programming knowledge in a non-object-oriented program- ming language. Even though the number of beginning students who have such knowledge continues to increase, it’s not something that one can generally assume to be true. In fact, when the ?rst edition of this book appeared, texts for beginning programming students generally did not teach object-oriented programming. In the meantime, even though the “Objects-First” approach has become increasingly common, it’s still relatively rare to en- counter Smalltalk as a ?rst programming language. For that reason, this book continues to ?ll a gap. It is intended not just for IT students, but for anyone who seeks a fundamental entry point for programming, especially object-oriented programming. For example, it can also be used for advanced IT courses in the later grades of secondary schools. Choosing Smalltalk is important above all for pedagogical reasons. Smalltalk is a sim- ple, strictly object-oriented language that practically forces one to think in an object- oriented way. In addition, almost all students can be said to suffer the same disadvantage, that of not knowing this language, which somewhat reduces the problems caused by the different levels of initial knowledge among the students. And furthermore, a variety of free development environments are available, which students can easily install on their own computers. With regard to its use in the real world of industry, Smalltalk is certainly not as impor- tant as, say, Java. On the other hand, so-called dynamic languages like Python and Ruby, which adapted many of their ideas from Smalltalk, are enjoying increasing popularity and wider distribution. Smalltalk is becoming increasingly important as an introductory pro- gramming language for children in elementary schools. In this context, one can mention viiviii Preface the Etoys and Scratch projects that have both been implemented in the Smalltalk dialect 1 Squeak. Squeak runs on nearly all available operating systems as well as on the OLPC XO computers (“$100 laptops”). This book, however, is not a programming-language course in a narrow sense. Above all, it should not be treated as a complete presentation of the extensive Smalltalk class library. For that, one must consult the relevant documentation for the development en- vironment being used. Nevertheless, it’s also necessary to treat the basic concepts of a development environment, since Smalltalk programming always occurs within one. For beginners in particular, this can be an additional impediment. Stated somewhat simply, it used to be enough to be able to use a text editor and a compiler; now, besides learning the basics of programming, a student must also learn technical skills for dealing with a complex development environment. An introduction to programming must also include fundamental knowledge of how to construct algorithms—a theme that is usually not dealt with in connection with object ori- entation. This is necessary because it is only through concerning oneself with the elemen- tary problems of programming that one can develop an understanding for how computers work. The ?rst chapter teaches readers enough basic concepts of computer science so that they can begin to learn programming. Then, in the second chapter, a simple example provides an initial introduction to the basic construction of algorithms and how to construct them in a speci?c programming language (in this case, Smalltalk). Later chapters bring up the topic of constructing algorithms again and again. While Chap. 2 ignores typical object-orientation concepts, they form the main topic of Chap. 3. At the same time, the chapter also introduces the basic elements of the Smalltalk programming language. Chapter 4 deals with programming repetitions (“loops”), once again in the context of algorithms. In addition, important methods available in the Smalltalk language for using loops are described. In order to make it easier for readers to perform practical exercises and to understand the examples provided in the text, Chap. 5 provides instructions for using the VisualWorks development environment, which is used for the programming examples shown in this book. Chapters 6, 7 and 8 centre on classes, which are the central concept of object orientation. The components of a class de?nition in Smalltalk are given ?rst, followed by a description of how to create new classes. This is followed by a description of important basic classes in a Smalltalk class library. This leads to the introduction of additional basic concepts of object orientation, such as inheritance and polymorphism. An entire Chap. 10 is devoted to collection classes, because of their complexity and importance. 1 OLPC means One Laptop per Child.Preface ix First though, Chap. 9 summarises information that was already presented in earlier chapters dealing with error messages in the compiler and the runtime system. If—as is likely the case—readers have been confronted with error messages as they reviewed ex- amples in earlier chapters or attempted their own exercises, it might be helpful to read this chapter earlier than its position in this text. Chapter 11 takes up in a systematic fashion important aspects of object-oriented pro- gramming with Smalltalk, some of which, such as blocks and inheritance, already ap- peared in earlier chapters. Chapter 12 picks up the principle of recursion, an important aspect of algorithms that cannot be omitted from an introduction to programming. Chapter 13 deals brie?y with processing sequential internal and external streams. It also explains how to access ?les from Smalltalk programs. Although space considerations prevent discussion in this book of the development of larger Smalltalk applications, Chap. 14 nevertheless provides a few elementary instruc- tions for how to structure programs. Chapter 17 provides suggestions for sources for this and other topics. The author’s website (https://brauer.nordakademie.de) also contains ad- ditional information to accompany this book. Before that, though, Chap. 15 deals with writing component tests and their automatic execution. The book does not attempt to contrast traditional, procedural development practice with object orientation. Readers who already have programming experience in procedural pro- gramming languages are advised to look at literature concerning the Oberon 2 program- ming language. Reiser and Wirth (1994), for example, provide an excellent description of the transition from imperative to object-oriented programming. It is important to emphasize once again that no previous knowledge of programming is necessary for successfully working one’s way through this book. It is nevertheless assumed that readers have basic skills in working with a windows-based operating system, such as Microsoft Windows or the Apple Mac OS. A Comment on Notation Programming text, to the extent that it is not shown as screen captures, appears as a monospace font. The same is true for various Smalltalk concepts, such as class or method names. Names of menus and menu contents are shown in boldface type. The Development Environment The Smalltalk system VisualWorks was used to create the examples in this book. This is a commonly used, professional Smalltalk development environment distributed by Cin- com Systems. A fully functional instructional version that runs on many platforms can be downloaded from Cincom’s website, www.cincomsmalltalk.com. Although it is not essen- tial, it will prove very helpful to readers to have access to this system. Screen captures in this book were taken from Version 7.6 of VisualWorks.x Preface Acknowledgements First of all, I want to thank the publishing company and especially Dr. Klockenbusch, whose engagement is responsible for the appearance of the ?rst edition of this Smalltalk book at a time when the whole world was talking only of a programming language whose name bears a resemblance to coffee. I owe thanks to Sybille Thelen for her support in the publication of this third edition. I want to thank the employees of the Georg Heeg Company for their critical review of the ?rst draft of this book and for several valuable corrections, suggestions and improve- ments. I also want to thank my former colleague at the NORDAKADEMIE, Professor Kleuker. Katrin Schimmeyer and Helmut Guttenberg helped me greatly in my struggles toward an orthographically and syntactically correct text. I want to thank Jan Bartelsen for reviewing the third edition. Elmshorn Johannes Brauer August 2008AddendumtothePrefacefortheFourthEdition For this fourth edition, various small changes and corrections were made throughout the text. In addition, the numerous screen captures for the VisualWorks development environ- ment were updated. For this, I want to thank Cincom Systems, which made Version 7.10 available to me before its release. For her support in this, I want especially to thank Yvonne Schickel. The most signi?cant improvement, however, is Chap. 16, which deals with an intro- duction to the development of Web applications in Smalltalk using the framework system, Seaside. The motivation for this chapter rests not least in the fact that the bachelor’s de- gree program for computer science at NORDAKADEMIE is now called “object-oriented development of Web applications.” For reviewing this material and for their valuable suggestions, I am especially grateful to the following people: Stefanie Jasser, Joachim Sauer, Heiko Rehder, Daniel Purrucker and Carsten Becke. I also wish to thank Bernd Hansemann of Springer Vieweg for his support in the publi- cation of this fourth edition. Elmshorn Johannes Brauer September 2013 xi"

Related Documents

Start searching more documents, lectures and notes - A complete study guide!
More than 25,19,89,788+ documents are uploaded!

Why US?

Because we aim to spread high-quality education or digital products, thus our services are used worldwide.
Few Reasons to Build Trust with Students.

128+

Countries

24x7

Hours of Working

89.2 %

Customer Retention

9521+

Experts Team

7+

Years of Business

9,67,789 +

Solved Problems

Search Solved Classroom Assignments & Textbook Solutions

A huge collection of quality study resources. More than 18,98,789 solved problems, classroom assignments, textbooks solutions.

Scroll to Top