Acknowledgments
Acknowledgments
Introduction
Approach
Layout of the book
Examples
Target audience
About Smalltalk
Features of Smalltalk
Interpreted language
Browsers
The Debugger
The Class Library
The Garbage Collector
Object-Oriented Thinking
Modifying and Extending the Environment
Smalltalk is reflective
Summary
Acknowledgments
Basic Concepts
Objects
Encapsulation
Classes
The Class as code respository
The Class as factory
The Class as abstractor
Inheritance
Polymorphism
Abstract Superclasses
Summary
Acknowledgments
Messages
Unary Messages
Binary Messages
Keyword Messages
Message chaining
Message precedence
What happens when a message is sent
The receiver of the message
self
super
Acknowledgments
Methods
Method Types
Method Length
Method names
Stupid methods
Method formatting
Public and Private methods
Returning from a method
Return object defined by method name
Return object defined by last statement
Guard clauses
Consistency in objects returned
Misplaced Methods
Number of Methods
Defaulting Parameters
Method Template
Acknowledgments
Variables
Variable names
Instance variables
Class variables
Classes referencing their instances (advanced)
Class instance variables
Parameters
Method parameters
Block parameters
Temporary variables
Temporary to the method
Temporary to the block
Global variables
Variables as slots
Accessors
Accessors for collections
The five accessor approach
Accessors or Direct Referencing
Direct referencing
Referencing through accessors
Which way to go
Chains of accessors
Documentation on variables
Acknowledgments
Instance Creation
Setting default values
Overriding new
Setting instance specific values
Overriding new to avoid it being used
Avoiding the use of new:
Sole instances of a class
Acknowledgments
Special Variables, Characters, and Symbols
Character Pairs
"This is a comment"
'This is a string'
(2 * 3)
[some code]
Prefixes
Special Variables
Assignment
Return
Statement Separator
Cascading
Automatically Constructed Objects
SmallInteger
Float
String
Character
Symbol
Array
BlockClosure
= and ==
Identically equal
Equal
Acknowledgments
Global Variables
Global Dictionary
Pool Dictionaries
Class side variables
Default instances
Environment Variables / Command Line Arguments
Image Version Number
Acknowledgments
Control Structures
Conditional Execution
Looping
Repetition
Optimized Messages
Acknowledgments
Object-Oriented Thinking
Little steps
Write down the concepts
Put off the work
Tell, Don't Ask
Don't check the results of doing things
Signs of Object-Oriented Thinking
Short methods
No dense black methods
No super-intelligent objects
No manager objects
Objects with clear responsibilities
Not too many instance variables
Getting started with Object-Oriented Thinking
Acknowledgments
Object
Accessing
Changing
Class membership
Comparing
Converting
Copying
Dependents access
Error handling
File In/Out
Initialize-release
Message handling
Printing
System primitives
Testing
Updating
User interface
Acknowledgments
Collections
Collection types
OrderedCollection
SortedCollection
List
Array
Dictionary
Set
Bag
LinkedList
Creating new collections
new:
new
The with: family
Adding to and removing from Collections
Enumerating
do:
collect:
select:
reject:
detect:
inject:into:
Enumeration wrap-up
General messages for collections
Adding objects
Removing objects
Accessing and locating objects
Replacing objects
Sizes and counts
Testing
Creating other collections from a collection.
Growing collections
Acknowledgments
Strings
Creating a string
Adding to a string
Comparing strings
Changing case and converting to a number
Pattern matching
Looking for characters or words in a string
Replacing characters
Creating a new string
Modifying the string in place
Getting a substring
Expanding a format string
Additional useful methods
Trimming white space from a string
Capitalizing a string
Acknowledgments
Streams
Streams and their uses
Streams in printOn:
Streams in file access
Streams on strings
The benefits of a Stream
Creating streams
Reading, writing, and positioning streams
Writing
Reading
Positioning
Example
Acknowledgments
Files
Filename
Opening files
Closing files
What files are open?
Reading from and writing to files
Reading text files
Reading and writing binary data
Positioning
End of line character
Flushing buffers to disk
Utilities
Class side utilities
Instance side utilities
Directories
Contents of files
Information about files
Manipulating files
Acknowledgments
Printing Objects
Display strings
Printing formatted numbers, dates, and times
VisualWorks 2.5
printf-scanf
Acknowledgments
Processes
Priority
Communicating between Processes
The SharedQueue
The PrioritySharedQueue
A general SharedQueue reading mechanism
Terminating processes
Making shared data threadsafe
Controlling the running of the process
Interrupting Processes
Working with Processes
Tracking processes with a Global variable
Tracking processes by subclassing
Microsoft Word - 19 - Chapter 17 - Coordinating and Sequencing Events.doc
Acknowledgments
Cleaning up at Termination
The CleanUp object
Using the CleanUp object
Other approaches
Acknowledgments
The Dependency Mechanism
Basic Dependency
Underlying mechanism
Model
expressInterestIn:for:sendBack:
onChangeSend:to:
Which mechanism should you use?
Broadcasting
Dependency Considerations
Dependency violation
Breaking dependencies
Acknowledgments
Error Handling
Signals and Exceptions
Creating your own signal
A single application signal
Multiple application signals
Overriding errorSignal
Central error messages
More on Signal Creation
Specifying the proceedability of the signal
Notifier strings and inspector information
Parents handling signals
Signal collections
Handler lists / collections
Passing information with an Exception
raise
raiseWith: aParameter
raiseErrorString: aString
raiseWith: aParameter errorString: aString
Parameter Substitution
raiseWith:errorTemplate:
raiseWith:errorPattern:
Handling the exception
return
returnWith:
reject
restart
restartDo:
self error:
doesNotUnderstand:
valueNowOrOnUnwindDo:
Emergency Exception Handler
noHandlerSignal
Exceptions and Processes
When to look for errors
Acknowledgments
Debugging
Bringing up a Notifier window
Using a Debugger window
Inspectors
Modifying values in an Inspector
Halting
Modifying halt and halt:
Writing your own myHalt and myHalt:
Conditional halting
Halting without adding a halt
Writing information to a file or the Transcript
Audible and Visible information
Monitoring activity of objects
A brief aside
Objects not being garbage collected
Public Domain debugging software
Commercial debugging software
The Smalltalk Professional Debug Package
Object Explorer
Acknowledgments
Common Errors
Notifier window messages
Losing code you modified in a debugger
Removing from a collection you are iterating over
Not returning the injection variable in inject:into:
Missing ^
Not implementing =
Assuming that messages return self
Incorrect messages to Booleans
Not reinitializing class variables
Problems with copies
Modifying copy of non-collection object
Modifying copy of collection
^ in block returns from method
Modifying a literal array
Acknowledgments
Model-View-Controller
Why is Model-View-Controller important?
How are they tied together?
The macro and micro view
The ApplicationModel Framework
ValueHolder
AspectAdaptor
Subject Channels
Summary
Acknowledgments
MVC Dependencies
Example One: Using addDependent:
Example Two: ValueHolders
Example Three: AspectAdaptors
Example Four: Subject Channels and differently named accessors
Example Five: Delaying updates
Example Six: Aspect Paths
Example Seven: Buffered Aspect Paths
Example Eight: PluggableAdaptors
Summary
Acknowledgments
Hooks into the System
Copying
postCopy
copyEmpty:
User interface opening
initialize
preBuildWith: aBuilder
postBuildWith: aBuilder
postOpenWith: aBuilder
Support methods
User Interface closing
changeRequest
requestForWindowClose
noticeOfWindowClose:
Acknowledgments
Changing Widgets at Runtime
The builder
Components
Widgets
Controllers
Modifying things
Enabling and Disabling
Visible and Invisible
Changing labels
Changing selections and cursor position
Changing colors and fonts
Changing Menus
Replacing menus
Modifying menus and menu items
Creating the menu at selection time
Keyboard events and double-clicking
/Users/ducasse/Desktop/SmalltalkByExample/29 - Chapter 27 - Extending the Framework.pdf
Acknowledgments
Eliminating Procedural Code
Tell, don't ask
Processing external objects
perform:
Dictionary of classes
Summary
Acknowledgments
Meta-Programming
Classes and Metaclasses
Adding general class side behavior
Examples we've seen in other chapters
Examples we promised in other chapters
Finding classes with a specified protocol
allInstancesAndSubInstances
Creating accessors for instance variables
A brief overview of other capabilities
Acknowledgments
Testing
The Test class
Building the TstTest class
The Test Result
The Test Manager
Running Tests
All Tests
Selected Tests
Running tests that never complete
Loading in the tests
Acknowledgments
Customizing your Environment
Keyboard
VisualWorks 2.5 change
Launcher
Window label
Other menu
VisualWorks 2.0
VisualWorks 2.5
Both
Changes
VisualWorks 2.0
VisualWorks 2.5
Both
Default browser
Adding VisualLauncher menus to a mouse button
Templates
Screen Color
Speed up startup
Acknowledgments
Changes to System Classes
Subclass where possible
Types of changes to system classes
Development environment vs. deployed classes
Added vs Modified methods
Summary
Distinguishing your additions and modifications
Some useful additions
Acknowledgments
Managing Source Code
Change Set
Filing in code
Filing in the application
Filing in development environment changes
Generic Development Environment changes
Using a class to file in the code
Filing out
Creating a production image
Common to VisualWorks 2.0 and 2.5
VisualWorks 2.0
VisualWorks 2.5
Common to VisualWorks 2.0 and 2.5
Saving the mkIm image
Runtime Packager
Acknowledgments
ENVY
Code sharing
Applications and subapplications
Version Control
Visibility
Methods
Classes
Applications
Products and subsystems
Scratch Editions
Management of Applications and Classes
Application manager diagram
An example of controlling parallel development
Code reviews
ENVY/Developer 3.01 enhancements
Additional Information
Microsoft Word - 37 - Chapter 35 - Public Domain Code and Information.doc
Acknowledgments
Source Files
Source files mentioned in chapters
New classes and subclasses
Files for installing applications
System class additions
System class modifications
Acknowledgments
Source Code forChapter 24
Superclasses
Example One
Example Two
Example Three
Example Four
Example Five
Example Six
Example Seven
Example Eight