Smalltalk User Guide
Smalltalk User Guide
About this book
Who this book is for
What's new?
Conventions used in this book
Tell us what you think
Getting started
The basic development environment
Browsers in the basic environment
System architecture
Image files
Loading and unloading components
Starting your image
Starting from the desktop
Starting from a command line
Accessing the command line arguments
Saving an image to keep components loaded
Using the Save Image option
Using the Save Image As option
Saving upon exit
System components
Software components
Getting started with team concepts
Version control
Scratch editions
Change and access controls
Component ownership
Application groups
Change controls
Access controls
Configuration management
Application lineups
Configuration map lineups
Organizing your team
Assigning team roles
Starting a project
The generic development process
Naming your components
Developing classes and creating individual baselines
Creating baselines as a team
Making your own applications
Creating applications
Creating applications--The basic steps
Example: Creating the application DevelopChooser
Setting application prerequisites
Checking prerequisites
Changing prerequisites
Example: Changing prerequisites for the application DevelopChooser
Defining group members for your application
Adding group members
Deleting group members
Assigning an application manager for your application
Assigning owners for classes
Defining classes
Defining a class--The basic steps
Using an existing class as a template
Using menu options
Example: Defining the class Chooser
Ensuring that the class you are subclassing from is visible
Creating a subclass
Adding variable declarations
Implementing methods
Implementing methods--The basic steps
Example: Adding methods to the defined class Chooser
Implementing the method open
Implementing the remaining ten methods
Opening Chooser
Ensuring that Chooser loads with DevelopChooser
Extending defined classes
Creating a class extension: The basic steps
Example: Extending the class Object
Example: Adding the method needsMoreWork to your class extension
Creating subapplications
Creating subapplications: The basic steps
Example: Creating the subapplication DevelopStopwatch
Creating a subapplication component
Defining the subclass Stopwatch
Implementing methods for Stopwatch
Opening the window
Completing work on your subapplication
Practice: Creating DevelopTextEditor and DevelopTimeLogger
A shortcut: Copying code into a browser
If you want to skip this practice...
Example: Creating DevelopTextEditor
Creating an application component for DevelopTextEditor
Defining the class TextEditor
Implementing the private instance methods
Example: Creating DevelopTimeLogger
Creating an application component for DevelopTimeLogger
Defining the class TimeLogger
Implementing the public instance methods
Implementing the private instance methods
Copying methods into TimeLogger
Using TrailBlazer browsers
Loading TrailBlazer
Opening TrailBlazer
Returning to the standard browsers
Example: Using TrailBlazer to create DevelopScreenCapture
Creating an application component for DevelopScreenCapture
Changing prerequisites
Example: Defining the classes ScreenPMCapture and ScreenWinCapture
Creating a subclass
Adding variable declarations
Example: Implementing methods for ScreenPMCapture and ScreenWinCapture
Implementing the private instance methods
Opening an instance of the screen capture tool
Categorizing the methods
Copying methods to the other platform-specific class
Example: Enabling a Display Image push button
Inspecting and debugging code
Inspecting objects
Using an Inspector
Inspecting variables
Evaluating expressions in the value pane
Changing variables
Using a Dictionary Inspector
Inspecting some dictionaries in the system
Inspecting your own dictionary
Adding and removing dictionary keys
Using a Basic Inspector
Debugging code
Opening a debugger and examining its contents
Determining the cause of an error
Finding errors in evaluated expressions
Finding errors in nonevaluated code
Examining a message stack
Inspecting variables from a debugger
Correcting errors from a debugger
Changing a method in the description pane
Changing an inspected object's variables and values
Adding breakpoints and executing code step-by-step
Adding the message halt
Adding breakpoints using menu options
Executing messages individually
Watching value changes
Browsing information on entries in a message stack
Generating an error report
Setting debugger options
Common errors to watch for
Messages not understood
Missing separators
Mismatched brackets or parentheses
Transcript Logging
Handling software components
Moving classes and methods
Moving classes between applications
Example: Making DevelopStopwatch into an application
Moving methods between classes in the same application
Moving methods between classes in different applications
Deleting components
Deleting classes
Example: Deleting the class extension from DevelopChooser
Deleting methods
Deleting applications
Deleting subapplications
Deleting a subapplication from one lineup
Deleting a subapplication from many lineups
Deleting application prerequisites
Deleting a prerequisite from the lineup in your image
Deleting a prerequisite from a lineup not in your image
Deleting a prerequisite from all lineups
Filing out and filing in components
What is the VAST chunk format?
Example: Examining the format of filed-out code
Filing out components
Filing in components
Filing in components stored in the generic chunk format
Example: Renaming a class and changing its methods
Monticello Importer
Handling team software components
Loading components from a library
Loading components: The process
Loading classes
Loading methods
Loading applications
If you know what application you want to load
If you do not know what application you want to load
Loading subapplications
Loading configuration maps
Example: Loading a configuration map
Unloading components from your image
Unloading classes
Unloading applications
Unloading subapplications
Unloading configuration maps
Creating new editions of existing components
Creating editions: the process
Creating class editions
Example: Creating a class edition
Creating application or subapplication editions
Example: Creating an application edition
Creating configuration map editions
Displaying configuration map timestamps
Loading other editions of components already loaded
Loading editions: The process
Loading class editions
Loading method editions
Loading application editions
Loading subapplication editions
Loading configuration map editions
Comparing editions
Comparing applications contained in two editions of a configuration map
Example: Comparing two editions of a single configuration map
Comparing classes contained in two application editions
Comparing methods
Comparing methods used by two class editions
Comparing two editions of one method
Comparing two methods used by one class
Comparing editions of two different configuration maps
Creating versions of components
Creating class versions
Example: Creating a class version
Creating application versions
Example: Creating an application version
Creating configuration map versions
Example: Creating a configuration map version
Releasing components
Releasing classes
Example: Releasing a class
Releasing applications
Replacing application editions or versions
Adding new applications to a configuration map
Releasing subapplications
Grouping applications using configuration maps
Creating configuration maps: The basic steps
Adding new applications
Replacing applications
Deleting applications
Adding, replacing, or deleting applications with TrailBlazer
Example: Creating the configuration map Chooser Map
Defining lineups for multiple platforms
Application lineups
Defining application lineups: The process and preconditions
Example: Defining application lineups for OS/2 and Windows
Configuration map lineups
Defining a configuration map lineup: The process and preconditions
Example: Adding a required map to a Chooser Map lineup
Replacing required map editions or versions in a lineup
Importing components
Importing user objects
Importing class versions
Importing application or subapplication versions
Importing configuration map versions
Exporting components
Exporting user objects
Exporting class versions
Exporting application or subapplication versions
Exporting configuration map versions
Setting exporting options
Steps for exporting configuration maps
Attaching non-Smalltalk files
About attachments
Attachment folders
Attachments and stored path names
Attachment types
No versioning of attachments
Opening the Application Attachments browser
Using the Application Attachments browser
Storing attachments
Retrieving attachments
Browsing attachments
Browser menu choices
Stored path names
How stored path names are derived
How stored path names are displayed
Supported platforms and file system types
Performing team system administration
Library operations
Creating libraries
Giving users access to libraries
Adding a user object to a library list
Changing to a different user object
Changing default libraries
Purging and salvaging components
Purging user objects
Purging applications and subapplications
Purging configuration maps
Cloning libraries
Recovering from crashes
Recovering from a file server or EMSRV crash
Recovering from image crashes
What the system checks
Invoking the check for consistency
Recovering lost components
Packaging, unloading, and analyzing code
Introduction to packaging
Packaging guidelines
Application prerequisites
Method dispatch
Class/global access
Accessing development environment information
Example: specifying launch code
Files to distribute with your application
Simple packaging
What to do before packaging your application
Running the packager
Possible problems
Starting Application
Example: Running the packager
Example: Packaging - saving packaging instructions
Running your packaged image
Example: Running DevelopChooser
Advanced packaging
Packaging: An overview
Advanced packaging: The process
Summary of packaging steps
Browse Packaged Images
Choose Instructions
Modify Instructions
Examine & Fix Problems
Save Instructions
Output Image
Version packing instructions
Running your packaged image
Example: Running DevelopChooser
Making applications "packager friendly"
Application centered packaging
Application packaging hints
Reducing the size of your packaged image
Reducing the number of classes and methods
Minimizing other objects in the packaged image
Exit due to error: 33--Could not open image file
Could not open image file
Exit due to error: 37--Image file is not an image
Does Not Understand errors
Problems during packaging
Packaging Statistics
Automated Build Support
Unloading ENVY/App image components
Unloading specific components
Compiled methods
Class variables
Class instance variables
Shared pool variables
Global variables
Unlinking all instances of a specific class
Example: Unlinking all instances of a class
Unlinking all instances of a specific method
Excluding version information
Setting the image startUp class
Running code at load time
Example: Specifying the class and selector to be run
Packaging with image components (ICs)
About ICs
Image components (ICs) and their benefits
Things to Consider: When to use ICs
Packaging preparation
Step-by-step examples building VA Smalltalk ICs
Creating a leaf IC
Creating a reusable and a leaf IC
Creating ICs to be explicitly loaded
Creating a platform-dependent IC
Creating the ICs
Implementation issues and tips
Understanding packaging instruction classes
Snapshot classes and snapshot IDs
How snapshot files are located
Exit due to error: 33--Could not open image file
Exit due to error: 37--Image file is not an image
Problems during packaging
Side effects of using the -r command line option
Error attempting to load into a read-only object
Primitive failures during explicit IC loading
Errors during IC packaging
Reference to excluded pool
Excessive packaging time
Evaluation images
Runtime error at startup
Development image fails to start-up (Error 33)
Loading and unloading ICs
Customizing the icon and splash screen
Changing the program icon on Windows
Providing a customized splash screen
Displaying the splash screen longer
Swapping objects between disks and images
Getting started
Simple object loading and unloading using files
Object loading and unloading using streams
Features of the Swapper
Basic features
Advanced features
Using the Swapper
Simple object loading and unloading
Object replacement
Object mutation
Application considerations
Classes and Metaclasses
Special object considerations
Rehashing of collections
Error processing
Where errors are generated
Error codes and their expected error objects
Debugging Swapper operations
The Swapper framework
Replacers and strategies as first class objects
When to define your own strategies
Analyzing the runtime performance of code
Quickly determining how long it takes code to run
Example: Having millisecondsToRun: display your code's run time
Analyzing code using the Benchmark Workshop
Writing the bench method
Overview of the Benchmark Workshop
Executing the bench method
Stabilizing the benchmark
Viewing the results
Browsing the time distribution
Browsing the method execution
Limitations when sampling [S]
Optimizing Smalltalk code
Using a Memory Monitor
Types of memory space that you can monitor
Interpreting the Memory Monitor display
Using a Memory Use Report
Memory usage by application, class, and method
Memory usage by application, class, and method
Memory usage during execution
Setting up, customizing, and extending the system
Using and maintaining configuration (.ini) files
.INI file syntax
.INI file contents
Library access stanza
Image component (IC) mapping stanza
CommonGraphics stanza
NLS and Locale stanzas
Feature Load stanza
Kernel stanza
Virtual machine options stanza
SocketCommunicationsInterface stanza
PlatformLibrary name mappings stanza
Development Tools stanza
Printing stanza
Preference Settings Framework
Executing scripted Smalltalk code during image start up
Setting up Smalltalk images
Using Preferences Workspace to configure images
Example: Evaluating an expression to change a setting
Extending the system
Changing Transcript menus
Methods that add or remove menus
Extending Browser Menus
Adding to browser menus
Controlling menu visibility
Application initialization
Application behavior when starting and stopping the system
Example: Using startUp to open DevelopChooser when the system starts
Application behavior when Windows Power Management events occur
User fields
Stored objects
Storing versions of objects in object stores