back next

Introduction

SystemBrowsers are the main tool for programming in smalltalk; they allow you to both browse through the system, search for methods and to create, modify or remove classes and methods.

The standard System Browser consists of 5 major subviews; the interresting components are:

  1. class category list
  2. class list
  3. class/instance toggle
  4. method category list
  5. method list
  6. code view

(the actual appearance of the Browser depends on the viewStyle setting; the picture above was taken with the "iris-style" in effect)

Notice:

This document describes the pre 10.4 systemBrowser. Starting with release 10.4, an additional view presenting the instance variables of the current class has been added. The menu items for variable-searches are now found on its popup menu.

Within the system, all classes are assigned to a class category, this category has NO semantic function of any kind, it is simply an attribute, to group classes for easier handling. (actually, beside the browser, there are not many uses of class categories.)

Once a class category is selected (by clicking on the entry in the class category list), the class list shows all classes belonging to that category.
The systemBrowser also offers two "special" categories: "* all *" which will display all classes and show them alphabetically, and "* hierarchy *" which also shows all classes, but indents them by inheritance as a tree.

Selecting a class in the class list, will show all method categories in the method category list. Like class categories, method categories are only used for grouping related methods; typically, methods are categorized by function or effect. Like class categories, these have no semantic effect.

Selecting a method category will show all methods in that category. The special category "* all *" shows all methods in alphabetic order.

Finally, selecting a method in the method list will show the corresponding methods source code in the code view.
Notice that, if the classes source file has been removed, or is not accessable, the codeview will show the string "no source available".

Also keep in mind, that these lists (like all selection lists) respond to keyboard events: especially, alpha-keys (search for the next entry with that character), cursor UP/DOWN, page UP/DOWN, HOME and END-keys are useful for navigation.

For examples on typical uses of the browser, see the last section(s) of this document.

Class vs. Instance

The browser allows working on both a class and its metaclass (i.e. the classes class). Smalltalk beginners should keep in mind, that classes are objects like anything else in the system - thus the behavior of classes is described by another class (the so called metaclass). The set of messages understood by instances of a class is called instance protocol, while the set of messages understood by the class is called the class protocol.
Just like instances inherit protocol from the superclass(es), class protocol is inherited from the metaclasses superclass(es).

To switch, there are two toggle buttons named "class" and "instance".
Selecting "instance" (which is the default) makes your changes affect the class, while selecting "class" makes them affect the metaclass.

If you are not too familiar with this concept, try the "hierarchy" function of the class-lists popupMenu - especially take a careful look at this hierarchy when looking at the class protocol.