Book contents
- Frontmatter
- Contents
- FOREWORD
- PREFACE
- INTRODUCTION
- 1 A DIAGRAM FOR OBJECT-ORIENTED PROGRAMS
- 2 CONSTRUCTING ABSTRACTIONS FOR OBJECT-ORIENTED APPLICATIONS
- 3 PLAYRGOUND: AN OBJECT ORIENTED SIMULATION SYSTEM WITH AGENT RULES FOR CHILDREN OF ALL AGES
- 4 A LABORATORY FOR TEACHING OBJECT-ORIENTED THINKING
- 5 THINK LIKE AN OBJECT
- 6 WHY STUDY SMALLTALK IDIOMS?
- 7 THE DREADED SUPER
- 8 ABSTRACT CONTROL IDIOMS
- 9 VALUEMODEL IDIOMS
- 10 COLLECTION IDIOMS
- 11 AN OBJECTWORKS\SMALLTALK 4.1 WRAPPER IDIOM
- 12 A SHORT INTRODUCTION TO PATTERN LANGUAGE
- 13 WHOLE LOTTA SMALLTALK: THE TECHNOLOGY
- 14 INSTANCE-SPECIFIC BEHAVIOR: HOW AND WHY
- 15 INSTANCE-SPECIFIC BEHAVIOR: DIGITALK IMPLEMENTATION AND THE DEEPER MEANING OF IT ALL
- 16 TO ACCESSOR OR NOT TO ACCESSOR
- 17 INHERITANCE: THE REST OF THE STORY
- 18 INHERITANCE: THE REST OF THE STORY (CONT.)
- 19 HELPER METHODS AVOID UNWANTED INHERITANCE
- 20 IT'S NOT JUST THE CASE
- 21 CRC: FINDING OBJECTS THE EASY WAY
- 22 DEATH TO CASE STATEMENTS
- 23 WHERE DO OBJECTS COME FROM?
- 24 PATTERNS AND SOFTWARE DEVELOPMENT
- 25 DISTRIBUTED SMALLTALK
- 26 WHERE DO OBJECTS COME FROM? FROM VARIABLES AND METHODS
- 27 BIRDS, BEES, AND BROWSERS—OBVIOUS SOURCES OF OBJECTS
- 28 USING PATTERNS: DESIGN
- 29 PATTERNS GENERATE ARCHITECTURES
- 30 SIMPLE SMALLTALK TESTING
- 31 ARCHITECTURAL PROTOTYPE: TELEVISION REMOTE CONTROL
- 32 DEMAND LOADING FOR VISUALWORKS
- 33 GARBAGE COLLECTION REVEALED
- 34 WHAT? WHAT HAPPENED TO GARBAGE COLLECTION?
- 35 SUPER + 1
- 36 CLEAN CODE: PIPE DREAM OR STATE OF MIND?
- 37 A MODEST META PROPOSAL
- 38 USES OF VARIABLES: TEMPS
- 39 VARIABLES OF THE WORLD
- 40 PATTERNS 101
- 41 FAREWELL AND A WOOD PILE
- AFTERWORD
- INDEX
7 - THE DREADED SUPER
Smalltalk Report, June, 1992
Published online by Cambridge University Press: 04 August 2010
- Frontmatter
- Contents
- FOREWORD
- PREFACE
- INTRODUCTION
- 1 A DIAGRAM FOR OBJECT-ORIENTED PROGRAMS
- 2 CONSTRUCTING ABSTRACTIONS FOR OBJECT-ORIENTED APPLICATIONS
- 3 PLAYRGOUND: AN OBJECT ORIENTED SIMULATION SYSTEM WITH AGENT RULES FOR CHILDREN OF ALL AGES
- 4 A LABORATORY FOR TEACHING OBJECT-ORIENTED THINKING
- 5 THINK LIKE AN OBJECT
- 6 WHY STUDY SMALLTALK IDIOMS?
- 7 THE DREADED SUPER
- 8 ABSTRACT CONTROL IDIOMS
- 9 VALUEMODEL IDIOMS
- 10 COLLECTION IDIOMS
- 11 AN OBJECTWORKS\SMALLTALK 4.1 WRAPPER IDIOM
- 12 A SHORT INTRODUCTION TO PATTERN LANGUAGE
- 13 WHOLE LOTTA SMALLTALK: THE TECHNOLOGY
- 14 INSTANCE-SPECIFIC BEHAVIOR: HOW AND WHY
- 15 INSTANCE-SPECIFIC BEHAVIOR: DIGITALK IMPLEMENTATION AND THE DEEPER MEANING OF IT ALL
- 16 TO ACCESSOR OR NOT TO ACCESSOR
- 17 INHERITANCE: THE REST OF THE STORY
- 18 INHERITANCE: THE REST OF THE STORY (CONT.)
- 19 HELPER METHODS AVOID UNWANTED INHERITANCE
- 20 IT'S NOT JUST THE CASE
- 21 CRC: FINDING OBJECTS THE EASY WAY
- 22 DEATH TO CASE STATEMENTS
- 23 WHERE DO OBJECTS COME FROM?
- 24 PATTERNS AND SOFTWARE DEVELOPMENT
- 25 DISTRIBUTED SMALLTALK
- 26 WHERE DO OBJECTS COME FROM? FROM VARIABLES AND METHODS
- 27 BIRDS, BEES, AND BROWSERS—OBVIOUS SOURCES OF OBJECTS
- 28 USING PATTERNS: DESIGN
- 29 PATTERNS GENERATE ARCHITECTURES
- 30 SIMPLE SMALLTALK TESTING
- 31 ARCHITECTURAL PROTOTYPE: TELEVISION REMOTE CONTROL
- 32 DEMAND LOADING FOR VISUALWORKS
- 33 GARBAGE COLLECTION REVEALED
- 34 WHAT? WHAT HAPPENED TO GARBAGE COLLECTION?
- 35 SUPER + 1
- 36 CLEAN CODE: PIPE DREAM OR STATE OF MIND?
- 37 A MODEST META PROPOSAL
- 38 USES OF VARIABLES: TEMPS
- 39 VARIABLES OF THE WORLD
- 40 PATTERNS 101
- 41 FAREWELL AND A WOOD PILE
- AFTERWORD
- INDEX
Summary
This is a bit of work I am particularly proud of. I wrote a little workspace that got me a method list browser on all the methods in the image that use “super” (that in itself was fun). Then I went through them trying to categorize each one. I felt like a real scientist there for a minute- taking samples, making hypotheses, testing them in the “real world.” The result is a “theory of super,” which is much simpler than the language feature (and perhaps not coincidentally quite similar to the “inner” feature of Simula, from which super was derived).
What is it with this super thing, anyway? The pseudo-variable super is a curious wart on the otherwise unblemished Smalltalk language design. Ordinary messages are sufficient to capture composition, conditionals, and looping. The three components of structured programming thus become unified in Smalltalk. Yes, but.…
The exception is super. It means the same object as self, but when you send it a message the difference is revealed. When you send an ordinary message the class of the receiver of the message is examined for an implementation of that message. If one is not found the superclass is searched, then its superclass, and so on until a method is found. Super circumvents normal message lookup. When you send a message to super the search begins in the superclass of the class in which the executing method was found.
- Type
- Chapter
- Information
- Kent Beck's Guide to Better SmalltalkA Sorted Collection, pp. 81 - 92Publisher: Cambridge University PressPrint publication year: 1997