29.11.2014 Views

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

Smalltalk and Object Orientation: an Introduction - Free

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

other systems. As the browsers, inspectors <strong><strong>an</strong>d</strong> debuggers are all derived from the same source,<br />

there is also consistency between (some of) the various implementations. In addition, the<br />

source code for these tools is also available with the ADE.<br />

Other l<strong>an</strong>guages now have similar environments (most notably Visual C++) h owever,<br />

most of them are modeled on those found in <strong>Smalltalk</strong> implementations <strong><strong>an</strong>d</strong> few of them<br />

illustrate <strong>an</strong>y pretence of consistency between vendors.<br />

Thus it is quite possible to say that <strong>Smalltalk</strong> is a programming l<strong>an</strong>guage, a set of extensible classes, a<br />

development environment or even a user interface development tool. It is, in fact, all of these.<br />

4.3 <strong>Object</strong>s in <strong>Smalltalk</strong><br />

In <strong>Smalltalk</strong> everything is <strong>an</strong> object (or should be treated as <strong>an</strong> object). For example, the following<br />

expression:<br />

2 + 3.<br />

should be read as the object 2 is sent the message +, with the argument the object 3. In fact in this case<br />

for efficiency sake the + message is hard coded into the virtual machine (you will learn about this later).<br />

However, if you search for the method + it is there, it is just that its implementation is hidden from you.<br />

This pure object view has some interesting side effects on the l<strong>an</strong>guage constructs such as<br />

conditional statements. They are really messages to the objects true or false rather th<strong>an</strong> being part of the<br />

l<strong>an</strong>guage syntax. Another example are the iterative control statements (the <strong>Smalltalk</strong> equivalent of for or<br />

while loops in procedural l<strong>an</strong>guages) which are messages to numeric intervals or blocks. You will learn<br />

more about these from Chapter 6 onwards.<br />

4.4 History<br />

The original goals for <strong>Smalltalk</strong> were described by Al<strong>an</strong> Kay in the early 1970s. The initial sketches<br />

that formed the basis for <strong>Smalltalk</strong> were heavily influenced by the idea of classes as <strong>an</strong> org<strong>an</strong>izing<br />

principle (taken from Simula-67), of turtle graphics (taken from the LOGO project at MIT) <strong><strong>an</strong>d</strong> of what<br />

is now called “direct m<strong>an</strong>ipulation” interfaces (inspired by the sketchpad drawing system, developed by<br />

Iv<strong>an</strong> Sutherl<strong><strong>an</strong>d</strong> at MIT Lincoln Laboratories in the early 1960s, <strong><strong>an</strong>d</strong> by Kay’s Ph.D. thesis on the<br />

FLEX machine). 2<br />

Between 1971 <strong><strong>an</strong>d</strong> 1975, Kay’s group at Xerox PARC designed <strong><strong>an</strong>d</strong> implemented the first real<br />

<strong>Smalltalk</strong> l<strong>an</strong>guage, environment <strong><strong>an</strong>d</strong> applications. This system included a number of technical<br />

innovations:<br />

• The l<strong>an</strong>guage was based entirely on the Simula concepts of class <strong><strong>an</strong>d</strong> message.<br />

• The l<strong>an</strong>guage had no fixed syntax . Each class was responsible not only for its own behavior <strong><strong>an</strong>d</strong><br />

state definition, but even for parsing the token stream that followed a mention of <strong>an</strong> inst<strong>an</strong>ce.<br />

The innovations in the development environment were equally radical. At that time bit mapped<br />

displays were considered expensive <strong><strong>an</strong>d</strong> arc<strong>an</strong>e. Nevertheless, Kay persuaded PARC to allow him to use<br />

bit mapped displays, which enabled Kay <strong><strong>an</strong>d</strong> his team to implement bit -mapped text in multiple sizes<br />

<strong><strong>an</strong>d</strong> styles, using multi-windowing environments, plus high level support for bit operations <strong><strong>an</strong>d</strong> graphics<br />

operations.<br />

The <strong>Smalltalk</strong> -72 system further took the view that there was no reason for a separate operating<br />

system, since the object paradigm could m<strong>an</strong>age all hardware resources at least as easily as <strong>an</strong>y other<br />

approach.<br />

By 1975-76, it had become clear that the lack of attention to issues of perform<strong>an</strong>ce <strong><strong>an</strong>d</strong> scale were<br />

hampering further invest igations. Kay’s group proceeded with a major redesign of all aspects of the<br />

<strong>Smalltalk</strong> system. In the l<strong>an</strong>guage area:<br />

2<br />

Note this section is based on information described in a paper by L. Peter Deutsch, called<br />

<strong>Smalltalk</strong>, which was presented at ECOOP’89 [Deutsch 1989].<br />

The Past, Present <strong><strong>an</strong>d</strong> Future of<br />

45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!