logo of the SSW institute ;)
Computer Science
System Software

Home

General
Staff
Contact
Partners
Alumni

Research
Areas
Projects
Papers
Books
Reports
Awards

Teaching
Lectures
Exams
B.Projects
M.Theses
PhD Theses
Go Abroad

Misc
Talks
Library
Gallery
Links
Search

Webmaster


Exercise on Object-oriented Programming

Goal

Gain practical experience with a purely object-oriented programming style.

Method

Develop a sample program in Smalltalk as an example for a pure object-oriented language.

Task

Create a "Look at me!" animation where a figure looks in the direction of the mouse pointer.

The program should display window containing a face with eyes. The eyes should look in the direction of the mouse pointer and follow mouse movements. Note that the eyes do not necessarily look in the same direction (for example, when the mouse pointer is between the eyes).

You can create a simple or sophisticated illustration, with pre-made bitmap images or by programmatically drawing the entire face and the eyes. The representation is entirely up to you. The smiley face shown here is just an example.

It should be possible to change size and proportion of the face (for example, by resizing the enclosing window, or with dimensions supplied as method parameters).

Important: You can easily find working examples of similar animations implemented in Smalltalk. You are encouraged to study such examples, but you must finally implement your own program. During the demo, you must be able to explain how you did it, and you should be able to demonstrate that your program works for faces with different sizes.

Development Systems

Squeak is an open-source development environment for Smalltalk.

Pharo is an alternative system with a more modern look. In fact, Pharo was built on top of the Squeak system.

Both Squeak and Pharo are available for Windows, Mac and various Unix variants. They come with a wealth of documentation, tutorials and examples. For further information, see the documentation and samples on the project pages.
It is mostly a matter of taste which of these systems you prefer. For the POPL exercise, you can use either.

Expected Results

When you present your results at the end of the semester, we expect you to critically discuss your own implementation with respect to Smalltalk compared to other object-oriented languages. Which language properties of Smalltalk did you actively use? Which of them were helpful for the given task? Which got in your way and required workarounds? What would your solution look like if you had implemented it in a different language, such as Java?

During your presentation, you must expect questions about the standard classes of Smalltalk. It is therefore highly recommended that you familiarize yourself with the available classes in the Smalltalk class library. You should be able to explain why you chose a certain class in your implementation.

Presentation

You have to present the result of your work in person at the end of the term. Please bring your own computer and prepare it for a quick demo, including a look at the source code of your implementation.
Don't start with the project at the end of the semester, but rather view it as a continuing exercise that you should do in parallel with the course.

The presentation takes place in room number 0204 (Blaschek's office, Science Park SP3, 2nd floor)