6.001 Recitation #12 – March 19, 2003

 

RI: Konrad Tollmar

 

Basic Object System

 

 

Object-oriented terminology

 

Class:       

specifies the common behavior of entities

in scheme, a "maker" procedure

 

 

 

Instance:

A particular object or entity of a given class

in scheme, an instance is a message-handling procedure made by the maker procedure

 

 

 

 

 

 

1. A Car maker

Write a HOP car-maker that create a message-handling procedure

, and maintain the states type and running. You should be able to get these states through the message type? and run? And you should be able to change the state running through the messages start and stop.

 

 

2. A Painter

 

Specify a Painter class that could set-up a paint area, and draw on that area using different colors. Use a Class diagram to specify the class, implement the class, and show with some instance diagrams how to create instances from this class.

 

 

3. A drawing program

 

Specify with an object-oriented model a drawing program. Use a class diagram to specify needed classes, and show how the classes relate to each other.