CS497CS Home Page
CS497 Home Assignments Lectures Links Resources CS497 Staff

Lecture context

Lectures are videotaped at two speeds.  "56K" is for people with a high-speed 56K modem, while "100K" is for people with
an even faster ISDN line or something similar.

The dates on the schedule indicate where you should be.  It is excellent to be ahead of schedule, and it is not good to fall
behind.

I have included questions below for each lecture.  If you are in a group, discuss these questions.  If you are by yourself, think
about them, because some of them will be on the final exam.

We found that demonstrations on a computer did not videotape well, so we are in the process of making special AVI files for
each demonstration.

If you see any links that might be wrong, please let me know.

Course Introduction

 Lecture 1

Basics of Smalltalk and OOP

People say that "In Smalltalk, everything is an object."  Moreover, computation is just sending a message to an object.  This
isn't quite true, but it is almost true.  What is the benefit of such uniformity?  In other words, what advantages do we get from
making everything an object and turning every computation into a message?  In Smalltalk, what is NOT an object?  What kind
of computation is not a message?  Explain what happens when you send a message to an object.

Lectures 2,3

The Smalltalk syntax does not have if statements or loops.  Instead, it has blocks and messages.  How can you build an if
statement or a loop from blocks and messages?  What is the advantage of having blocks and messages in your language?
How important are blocks to object-oriented programming?

What is an abstract class, and why is it important?

What is polymorphism, and how is it related to the idea that all computation is messages?

What are some of the disadvantages of making numbers objects and making arithmetic be messages?  What are some of the
advantages?

Lecture 4

Some languages have arrays and strings built in, but Smalltalk does not.  What is an advantage to leaving them to the class
library?  What is a disadvantage?

Collection is an abstract class.  What are some of the Template Methods in Collection?  (See the Design Pattern book if you
are not clear on Template Methods.)  What are the methods that you have to implement when you make a subclass of
Collection?  How could you find out if you don't have anybody to ask and the manual doesn't tell you?

Lecture 5

What are the key classes in the testing framework?  How do you use it?  How does the testing framework use inheritance and
polymorphism?  Does it have any abstract classes?

Lecture 6

How is equality different from identity?  Why is equality user defined?

The rule "when you redefine = then you must redefine hash" shows that the design of one class can have an effect on the
design of another.  Explain.

When is a copy of an object equal to the original?

How can you compose streams to make new streams?  How can you parameterize a stream to make a new stream?  How can
you make a subclass of a stream to make a new stream?  Which is better?

Lecture 7

What is a coding pattern that you have used in some other language (C, Fortran, Pascal, etc.)?  Why are coding patterns
important?  If you know C++ or Java, compare and contrast "constructors" in those languages with the Creational Methods in
Smalltalk.

Lecture 8

Design

The word "method" in "Design methods" means something different from the word "method" in Smalltalk.  How are they
different?  How are they the same?

Describe at least three ways that design methods can differ from each other.

Lecture 9

You should be reading Design Patterns by now. Read Composite, Strategy, Template Method, and Observer first.

What is a pattern?  How are design patterns different from coding patterns?  How are they similar?

Lecture 10

The dependence mechanism in Smalltalk is a special case of the Observer pattern described in Design Patterns.  What
aspects of it are special?

Lecture 11

GUI Framework

Read the design patterns Decorator, Adapter, and Mediator.

Lecture 12,13,14

Read the papers Patterns Generate Architectures, which is about the design patterns that go into HotDraw, and Documenting
Frameworks with Patterns, which is about the patterns that a user of HotDraw must follow. The first is the patterns inside
HotDraw, the other is the patterns in its applications. Both kind of patterns are important to a framework.

Read the design pattern State.

You have now seen three frameworks; the testing framework, Model/View/Controller, and HotDraw.  What characteristics
do they have in common?  How are they different from each other?  How do they differ from the Collection classes?  What
makes frameworks harder to learn than the classes we looked at first?

Lecture 15

Design in Context

Read the Visitor, Interpreter, and Iterator patterns.

Lecture 16

So, which is better, Interpreter or Visitor?
If you know C++ or Java, how are Iterators in those languages different from in Smalltalk?

Lecture 17

Read the five creational design patterns.   What kind of refactoring would you use to convert a program
that didn't use any of these patterns to one that used Factory Method?  How about a program that used
Factory Method to one that used Abstract Factory?

Lecture 18 ,19

Frameworks

Read the Command and Facade pattern.  Also, look at the papers about HotDraw again.  This time, think about the way the
papers are written, not about HotDraw.

What are the advantages to describing a system as a sequence of design decisions?
When you refactor a program, you do it as a sequence of changes.  How is that similar
to the description of HotDraw?  How is it different?

Lecture 20

I argue that it is a bad idea to try to design frameworks up-front, that you should design a framework
at the same time as you build some applications.  Suppose you were asked to build a framework for
something you had never built before?  What should you say?

Lecture 21,22,23

Miscellaneous

Read the Proxy pattern.  How does reflection make Proxy easier to implement in Smalltalk than it is in C++?

Lecture 24,25,26