Student Originated Software 1997-1998
Fall Quarter

A Software Engineering Course at
The Evergreen State College

ARCHIVE -

Student Originated Software

Object-Oriented Programming (Smalltalk)

Lecture 1a



Programming Language Paradigms....


what do we mean by this term?

what are they? (and give some examples...)

imperative/procedural

functional

OO

logic & constraint

concurrent/distributed



other ways to categorize programming languages?

  • high/lo level

  • 4GL, 3GL

  • structured/not

  • typed/not

  • compiled/interpreted (one-pass, several pass)

  • 'complete'/ not

  • lazy evaluation

  • side effects/not

  • scoped/not

what do we take in account when we select a programming language for a system:

  • is it available? (or, affordable)

  • do we know it?

  • is it appropriate to the application?

  • how well does it contribute to the software development at hand?

  • what factors in selecting a language _to teach_

  • how is it to learn?

  • does it have pedagogical value?

  • will the students like it?

  • will it be useful to them? directly, indirectly?

  • (can we support it, and afford it)

  • distinguish between concept, ability, skill

why OO?

why smalltalk?

  • purely OO - objects all the way down
  • dynamically typed
  • multiplatform,
  • interpreted,
  • programming environment
  • extensive library
  • A VERY USEFUL LANGUAGE (INCREASINGLY POPULAR, IN SPITE OF JAVA)

-----------

advice:

  • smalltalk learning curve

  • be prepared for culture shock (not for the waterfall model!)

  • start off small

  • explore and work interactively

  • be prepared to throw code away

  • get some help -- work with your partner!

objects

  • what's an object: code + data

  • methods encapsulate variables

  • invoking methods?

  • objects send, receive messages;

  • sender, receiver;

  • defining objects - classes and instances

  • inheritance, overriding, polymorphism (next week)

    • using models for software development - modeling the real world!

    • models real world objects - data, plus behavior,

    • relationships about objects

about smalltalk

  • history
  • structure -
  • development environment
  • class library
  • a language

what is your model of the stored program? (say, a C program?)

program (code), and _state_

what do you think it looks like with smalltak?

you are adding code dynamically, and creating objects

the smalltalk virtual machine -- interprets code as it comes in

"the image" -- where code and object instances are stored

implementation (visualworks)

the Smalltalk Virtual Machine (your image is its memory)

the development environment (your classes + class library)

(this is why ST is so portable!)

next week - where these things live....

the language....

naming conventions - height, myHeight; Book, aBook; Employee, anEmployee

literals and constants

numbers

strings

symbols and arrays (inspect an array)

constants

true, false (vs. True, False)

nil

UndefinedObject

variables - Smalltalk variables are typeless

the temporary variable <origin> - can hold anything!

| origin |

origin := Date today.

origin := 5.

origin := 'nature'.

origin := origin.

(next week - class varibles)

sending messages

MyStorageSystem initialize.

aSquare increaseSizeBy: 2.

wendy employ: 'Shannon' as 'a Smalltalk Programmer'

Database open: 'students.dat' using: key rwMode: 7.

message separator - '.'

sender, receiver; self.

assignment

^true.

Total := net + tax.

aSeminar := Seminar with: people size:15.

dougsSeminar := aSeminar.

| origin |

origin := 3+5.

origin := 'apple' .

Transcript cr; show: origin.

every message expression has a value.

combining messages.

chaining

aTriangle height asInteger.

unary, binary, keyword

unary, binary, keyword; left to right.

()s change order!

MyCollection add: Pyramid new initialize.

(you don't need to know what this means to give its eval order)

(book openAtPage: 1+2*3) print

cascading messages

diskController reset intialize startRunning.

diskController reset; intialize; startRunning.

(most methods return self, usually by default, but not always!)

about visual works (minimal subset)

launcher (aka main window)

workspace

browser (to look at classes)

the transcript

ho1

getting started on smalltalk in the lab (shannon)

demo1 - in class

  • launcher, main window (aka transcript)

  • briefly explain each menu and each icon

  • what we'll use today - main window, workspace

  • workspace

  • select function (editing), operate function (undo),

  • opening another workspace

  • select text (drag, double click - word, line; shift click)

  • getting a printout....

Transcript cr.

Transcript show: 'Hello world!'

what are the messages, what kinds of messages...

demo1 - in lab

running visual works HERE

demo2

browsing the class hierarchy

SAVING YOUR IMAGE....file-out-as

don't save in the default location

use a fully qualified file name

must use file settings...

[ SOS Home Page | Case Study | Year Long Projects | OOP ]


For more information contact
[ Evergreen Home Page | Academic Programs ]


Created by: SoSwEbGrOuP
E-mail: ringert@evergreen.edu