Smalltalk and pure object oriented programming

OO Focuses on the Data

Pure Object-Orientation: Everything is an object

More about objects

What is a class?

Classes are also objects!


Diagram of Ball class and its instances

Everything is an object!

is-instance-of relationship

is-a relationship

Object hierarchy

Computation via messages and methods

Object-oriented vs. procedural terminology


Features of Smalltalk-80

Smalltalk Class Browser

Class Hierarchy Pane The Class Hierarchy Navigator

Variables Pane A Filter for the Methods Pane

Methods Pane A Listing of the Relevant Methods

Method Definition Window

So where’s my program?

Filing out your code

Filing in code

Asking questions about code

Learning more about Smalltalk/Express Environment

Simple Smalltalk Syntax

More Smalltalk Syntax

Stack Object Implementing a Stack ADT

Stack Object Methods

Adding a subclass

Adding a class method

Adding an instance method

More stack methods

Shared Variables

Private variables


Constructing a Stack

Object construction in Smalltalk

Initializer method

Common mistakes


Superb Debugger!

Message terminology

Three kinds of Messages

Parsing Messages

Parsing keyword messages

The importance of the colon:

Cascading messages

Message dispatch

Dispatch examples

Method terminology

Dispatch algorithm

Talking to yourself

Smalltalk schizophrenia

Writing draw without message dispatch

So what’s the big deal?


Overriding a method

Replacing a method

A less drastic change in behaviour

Do not duplicate code!

Getting help from your parent

super keyword

Example of super

Sample message sends

A small change

More message sends



Blocks ? Scheme’s lambda

Blocks package up code

Class Boolean

Class Boolean has no state!

While loops

Common mistakes

Collection classes

Collections understand lots of messages...

do: and collect: messages

Dictionary class

The Smalltalk object

Smalltalk summary