Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
254 views
Smalltalk - Objects and Design PDF
Uploaded by
Alberto Luis Valdivia Gachinad
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Smalltalk - Objects and Design.pdf For Later
Download
Save
Save Smalltalk - Objects and Design.pdf For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
254 views
Smalltalk - Objects and Design PDF
Uploaded by
Alberto Luis Valdivia Gachinad
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Smalltalk - Objects and Design.pdf For Later
Carousel Previous
Carousel Next
Save
Save Smalltalk - Objects and Design.pdf For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 304
Search
Fullscreen
Smalltalk, Objects, and Design Chamond Liu toExcel San Jose New Yark ShanghaiSmalltalk, Objects, and Design Reprinted from the original 1996 edition with corrections: rights reserved. Copyright © 1999 ly Chamond Lit No part of this book may be epproduced or transmiced in any form.or by any eneans, .gtaphic, electronic, of mechanieal, including photocopying, recoeding, taping. of by any information storage ae retrieval system, without permission in writing from the publisher. “The author and the publisher of this hook make no warranties of any kind, expressed ‘or implied, with regard to che information contained in this book. The author and publisher shall not be liable in any event For any loss oF damages caused by, oF atising out of, the use of information contained in this book, All products mentioned in this book are ccadematks or registered trademarks of their respective holders. Use ofa term in this book should nat be regarded as affcering the validity of any trademark or service mark. Published by toExcel For information address: ToExcel 165 West 95th Street, Suite BAN New York, NY 10025 wwmsreercel.com ISBN 1-58348-490-6 Printed in the United States of Ameties“My good friend, every profession requires effort and devotion and practice.” —advice to the young Perceval [de Troyes 1190]Contents Acknowledgments xi Preface xiii 1 Objects 1 1d 12 13 14 Ls 16 1? Objects 1 Examples of Smalltalk messages (telegrams) 5 Pitfall: the effect versus the return 6 Why objects matter 7 Recap: objects & Exercise: warmup (the image) 9° Commentary: perspectives on objects 2 Classes and inheritance 11 al 22 23 24 25 2.6 2? 28 29 2.10 2 212 213 Classes 11 The word “class” 13 Inheritance 13 Terminology 18 Exercise: hierarchies 21 Solution and discussion: Aggregation hierarchies 21 inheritance 22 Syraxes for inheritance 23 Example: inheritance in Smalltalk 24 ise: building aclass hierarchy 26 Commentary: what is object-oriented programming? 27 Commentary: other languages 29 Commentary: history 303 Smalltalk introduction 32 31 32 33 3A 35 3.6 a7 3B 3a Elementary objects 32 Messages and their precedences 33 Pitfalls: basic Smalltalk gotchas 34 Examples 36 Exercise: a hypothetical method 37 Solution and discussion 38 Kinds of variables 39 Pitfall: variables # objects 40 Classes are objects 40 3.10 Control flow 42 3.11 Commentary: metackasses 43 4 Exercises—Foundations 44 41 42 43 4A 45 Precautions 44 Finding things in Smallualk 46 Elements of Smalltalk 48 Smalltalk’s debugger 57 Provecations 59 5 Abstract classes 61 Exercise in object-oriented design 62 Solution and discussion 62 Pure virtual (subclassResponsibility) methods 64 Exercise: discovering pure virtuals 65 Solution and discussion 65 Ensuring no instances 65 Conerete behavior in abstract classes 67 Summary: methods in abstract classes 68 6 Containers and other indispensable ideas 69 6.1 62 63 64 65 6.6 67 68 69 Heterogeneity and hamogencity 70 Exercise: heterogencity and homogencity 71 Exercise: dictionaries 72 Exercise: identity dictionaries 75 Overriding equality 75 Excreise: anomaly of the disappearing clement 76 Exercise: excursion into Streams 77 6.10 Containers versus aggregations 78 G.11 Shallow and deep copying 796.12 Commentai value and reference semantics 80 6.13 Commentary: containers in C++ 81 7 CRCeards 82 Design exercise 83 Solution and discussion 84 Common questions and answers 87 Commentary: analysis, design, and implementation 88 8 Exercises—Implementing a design 91 81 83 84 85 86 87 88 89 Creare the classes 91 Atestease 91 Write “new” methods 92 Write instance methods 92 ‘Test your solution 93 Engineering discipline 94 A minor variation 94 “Private” methods 94 Commentary: getters and setters 95 8.10 Summary % 9 When (not) to inherit 97 Historical background 97 Inverting hierarchies 98 Buy or inherit? 99 Exercise 100 Solution and discussion 100 Conclusions 102 Commentary: multiple inheritance 103 10 Use cases and dynamic relationships 105 10.1 10.2 10.3 0.4 10.5 10.6 10.7 Interaction diagrams 105 Exercise 108 Solution and discussion 109 Use cases and interaction diagrams in analysis and design 110 Limitations 112 Summary 113 Commentary: historical note 114 HL The venerable model-view-controller 115 Mal 2 3 Model-view-controller example 115 Exercise 118, How MVC works 119114 Exercise: the original dependency mechanism 121 1.5 MVC: benefits and difficulties 122 11.6 What's become of MVC? 124 12 Building windows 127 12.1 What you need to know about Motif 128 12.2 Widget resources 130 123. Excursion: pool dictionaries 131 124 Exercise: afi window 133 12.5 Exercise: a window for the account balance 134 12.6 Exercise: a window far the sransaction log 135 12.7 Exercise: a window containing both widgets 136 12.8 Assessment: building windows 136 12,9 Callbacks and events 137 12.10 Preparation 138 12.11 Exercise: mouse event handling 138 12.12 Challenging exereise: dynamic updates 139 12.13 Summary 140 13 Designing the UI: a brief tour 142 131 User interfaces 142 13.2 Elementary examples 143 13.3 Coherent conceptual models 144 134 Metaphor 146 13.5 Magic 148 13.6 Exercise: design a user interface 151 13.7 Discussion of your results 152 13.8 Isomorphism 155 139 Summary 156 14 Polymorphism 158 14.1 Dynamic binding 158 14,2 Dynamic binding enables...polymorphism 159: 14,3 Aword on terminology 161 144 Exercise: polymorphism 162 14,5. Solutions and discussion 162 14.6 Exercise: Smalltalles Pless-ness 163 4.7 Solution 163 14.8) Summary tip 165 14,9 Commentary: performance 165 14.10 Commentary: Smalltalk, C++, and type-checking 166the tomato in the mailbox 169 14,12 Commentary: multi-methods 170 15 Practicing polymorphism 173 15.1 15.2 5.3 15.4 15.5 15.6 Design exercise |: a shape editor 173 Solution and discussion 174 Design exercise II: undo and redo 176, Solution and discussion 177 Impkmenting undo 179 Summary 180 16 How object-oriented languages work 181 16.1 162 16.3 164 165 166 167 16.8 Virtual machines 181 Method lookup 183 Memory management: a brief history of garbage collection 187 The irony of garbage collection 191 Commentary: why not garbage collect C++? 192 Smalltalk deviates from uniformity 193 Exercises 195 Summary 197 17 Tivo kinds of inheritance 198 Beauty and the beast 198 Why types matter: polymorphism 200 Commentary: an aside on subsets 201 Commentary: what docs “consistency” mean? 201 Consistency and Smallealk 207 Exercise: Smalltall’s container “types” 208 Solution and discussion 208 Exercise: Smalltalk’s container “classes” 210 Solution and discussion 210 17.10 Summary 211 17.11 Commentary: standardizing Smalltalk 212 18 Design patterns 213 18.1 18.2 18.3 184 18.5 18.6 Notation 214 Smart container (aka collection-worker) 215. Reification 216 Command 217 Factory method 219 Objects from records 220Proxies and ghosts, 1 224 Proxies and ghosts, Il 226 Dependency 228 Solitaire (aka singleton) 230 Duet (aka pas de deux, double dispatch) 231 Lawyer (aka object handler) 233 13 Compesite 235 14 Visitor 236 13 Conclusion 239 18.16 Commentary: history 240 19. Frameworks (one bearty example) 242 19.1 Problems 243 Mater 244 Searching (fikering) 248 Updating 251 Summary 252 Commentary: varieties of brokers 254 Commentary: buying outdoes inheriting (sometimes) 255 20 Metaclasses 257 20.1 Facts about metaclasics 257 20.2 Inheritance 258 20.3 Method new 259 204 ‘The full picture 260 20.5 Recapitulation 262 20,6 Exercises 263 21 Why developing software is still hard 264 21.1 Misconceptions 264 21.2 Where projects go awry: borders 267 21.3. Characteristics of succesful projects 269 21.4 An optimistic conclusion 272 Appendix: Some differences between dialects 275 References 277 Index 283Acknowledgments ‘This book derives from two activities—developing and teaching courses, and develop- ing software. But the real sources are the people I've encountered along the way. Many of them have profoundly shaped my thinking about software—Dave Collins, Peter Deutsch, Amarjcet Garewal, Steve Goetze, Ralph Johnson, Doug Lea, Bertrand Meyer, Tom Morgan, Dave Thomas, Rebecca Wirfs-Brock, and Kirk Wolf—and many others have left'smaller but chaotically important impressions: Bruce Anderson, Marilyn Bates, Katherine Betz, Desmond D'Souza, Phil Hartley, Richard Helm, Felix Laura, and John Vlissides. From here the list is too long to enumerate, for it includes individuals whom I sweated over their businesses’ real object-oriented design and. programming problems, plus all the students and instructors through the years from whom I learned about teaching objects and Smalltalk and C++. 1 am grateful co the many people who were kind enough to share their opinions on draft manuscripts. Bruce Anderson assailed. hackneyed expressions and examples; Kent Beck made me rethink my pedagogical approach; Katherine Betz streamlined discussions; Michele Choate caught stylistic slips; Eric Clayberg taught me new things: about Smalltalk; Dave Collins, a closet historian, set chronologies straight; Ken Coo- per pointed out awkward transitions; Lisa Goetze suggested improvernents to the exer- cises; Steve Goetze was a sounding board for impetuous ideas and, sensitive to the zeitgeist, warned me off gratuitous soapboxes; Ralph Johnson's enthusiasm and tact kept me going when there was still no end in sight; Doug Lea urged technical respect ability where there was none; Ruth Liu distinguished whar I actually said from what | meant (0 say; ‘Tom Morgan flushed our structural and conceptual flaws; Larry Smith was the conscience of the IBM Smalltalk product; Dave Thomas alerted me to trends from the ANSI standardization
You might also like
Joy of ST
PDF
No ratings yet
Joy of ST
678 pages
Kent Beck's Guide To Better Smalltalk - A Sorted Collection
PDF
No ratings yet
Kent Beck's Guide To Better Smalltalk - A Sorted Collection
427 pages
1987-Self The Power of Simplicity
PDF
No ratings yet
1987-Self The Power of Simplicity
16 pages
Small Talk
PDF
No ratings yet
Small Talk
105 pages
SmallTalk Tutorial
PDF
No ratings yet
SmallTalk Tutorial
571 pages
CH 12
PDF
No ratings yet
CH 12
28 pages
Oops
PDF
No ratings yet
Oops
8 pages
Object Oriented Analysis and Design
PDF
No ratings yet
Object Oriented Analysis and Design
25 pages
Simula and Smalltalk (Presentation)
PDF
No ratings yet
Simula and Smalltalk (Presentation)
7 pages
Dynamic Object-Oriented Programming With Smalltalk: Prof. O. Nierstrasz Autumn Semester 2009
PDF
No ratings yet
Dynamic Object-Oriented Programming With Smalltalk: Prof. O. Nierstrasz Autumn Semester 2009
54 pages
SE Chapter One
PDF
No ratings yet
SE Chapter One
30 pages
Essential ActionScript 3 0 1st ed Edition Colin Moock pdf download
PDF
100% (1)
Essential ActionScript 3 0 1st ed Edition Colin Moock pdf download
54 pages
Object-Oriented Metrics in Practice
PDF
No ratings yet
Object-Oriented Metrics in Practice
211 pages
PROGRAMMMETHODSMyNote 2
PDF
No ratings yet
PROGRAMMMETHODSMyNote 2
84 pages
MOU Sponsorship
PDF
No ratings yet
MOU Sponsorship
13 pages
Chapter 1 - Object-Oriented Programming - Essential Concepts
PDF
No ratings yet
Chapter 1 - Object-Oriented Programming - Essential Concepts
37 pages
Unit-1 JAVA Notes
PDF
No ratings yet
Unit-1 JAVA Notes
87 pages
Programming As An Experience: The Inspiration For Self
PDF
No ratings yet
Programming As An Experience: The Inspiration For Self
28 pages
Software Design by Example - (Z-Library)
PDF
No ratings yet
Software Design by Example - (Z-Library)
343 pages
Classes Versus Prototypes in Object-Oriented Languages
PDF
No ratings yet
Classes Versus Prototypes in Object-Oriented Languages
5 pages
Introduction To OOP Concepts
PDF
No ratings yet
Introduction To OOP Concepts
65 pages
Ti Python
PDF
100% (2)
Ti Python
177 pages
Language Design and Overview of COOL: Instructor: Fredrik Kjolstad Slides Based On Slides Designed by Prof. Alex Aiken
PDF
No ratings yet
Language Design and Overview of COOL: Instructor: Fredrik Kjolstad Slides Based On Slides Designed by Prof. Alex Aiken
26 pages
Full Download (Ebook) Object -oriented Programming with Smalltalk by Wertz, Harald ISBN 9780081008089, 9781785480164, 0081008082, 1785480162 PDF DOCX
PDF
100% (1)
Full Download (Ebook) Object -oriented Programming with Smalltalk by Wertz, Harald ISBN 9780081008089, 9781785480164, 0081008082, 1785480162 PDF DOCX
67 pages
Advanced Programming Techniques: Course 689-???
PDF
No ratings yet
Advanced Programming Techniques: Course 689-???
5 pages
Programming Languages (OOP)
PDF
100% (1)
Programming Languages (OOP)
27 pages
Computer Science Class 8
PDF
No ratings yet
Computer Science Class 8
57 pages
CPL Sample
PDF
No ratings yet
CPL Sample
13 pages
Class 2 Introduction To OOP
PDF
No ratings yet
Class 2 Introduction To OOP
22 pages
Slides - OOP With Smalltalk
PDF
No ratings yet
Slides - OOP With Smalltalk
51 pages
Final - SEIT - UNIT 1 - OOP
PDF
No ratings yet
Final - SEIT - UNIT 1 - OOP
55 pages
CSC_314___OOP_LECTURE_NOTES_1_UPGRADE
PDF
No ratings yet
CSC_314___OOP_LECTURE_NOTES_1_UPGRADE
37 pages
CSC241: Object Oriented Programming: Lecture No 01
PDF
No ratings yet
CSC241: Object Oriented Programming: Lecture No 01
41 pages
Chapter 1 - Introduction - To - Oop
PDF
No ratings yet
Chapter 1 - Introduction - To - Oop
22 pages
L14-OOP Concepts
PDF
No ratings yet
L14-OOP Concepts
27 pages
BCS-31 Block1 Unit1new
PDF
No ratings yet
BCS-31 Block1 Unit1new
21 pages
Chapter 1: Introduction To Programming
PDF
No ratings yet
Chapter 1: Introduction To Programming
5 pages
I Bca Java Theory Unit I Part 1
PDF
No ratings yet
I Bca Java Theory Unit I Part 1
11 pages
Oose Unit 1
PDF
No ratings yet
Oose Unit 1
142 pages
CSC 421 OOP JavaScript Is Client and OBJECT ORIENTED PROGRAMMING
PDF
No ratings yet
CSC 421 OOP JavaScript Is Client and OBJECT ORIENTED PROGRAMMING
27 pages
Guest Lecture
PDF
No ratings yet
Guest Lecture
4 pages
PHP Brilliance - Advanced Coding
PDF
100% (2)
PHP Brilliance - Advanced Coding
362 pages
Unit I (Introduction)
PDF
No ratings yet
Unit I (Introduction)
7 pages
Introduction
PDF
No ratings yet
Introduction
38 pages
Mod 1
PDF
No ratings yet
Mod 1
124 pages
Oo Design 2013
PDF
No ratings yet
Oo Design 2013
48 pages
Pps Notes 5
PDF
No ratings yet
Pps Notes 5
9 pages
Why Using Smalltalk For Teaching Object-Oriented Design
PDF
No ratings yet
Why Using Smalltalk For Teaching Object-Oriented Design
29 pages
OOSE unit-1 & 2
PDF
No ratings yet
OOSE unit-1 & 2
69 pages
C Language
PDF
No ratings yet
C Language
65 pages
Bluebook - Small Talk
PDF
No ratings yet
Bluebook - Small Talk
748 pages
Advances Java 2
PDF
No ratings yet
Advances Java 2
34 pages
ISD Lecture 1
PDF
No ratings yet
ISD Lecture 1
31 pages
Computer Programming Using Gnu Smalltalk
PDF
No ratings yet
Computer Programming Using Gnu Smalltalk
130 pages
Industrial Training Report: June - July 1997
PDF
No ratings yet
Industrial Training Report: June - July 1997
67 pages