CSCI 431: Object Oriented Programming Languages

We will look at a subset of object oriented programming languages

Smalltalk

Messages

Methods

Blocks

Inheritance

Creating methods

  • Create a new class - Use following 5-keyword method
  • An Example:
    Integer subclass:#Thing instanceVariableNames: 'aValue'
    classVariableNames: ' ' poolDictionaries: ' ' category: nil !
    # gives the name a global attribute

    ! Thing class methodsFor: 'Creation' !
    new | r |
    r _ super new
    ^ r init !
    (super is superclass of self object)

    ! Thing methodsFor: 'Using things' !
    init aValue _ 0 !!

    Smalltalk Design Features

    More about Smalltalk

    C++

    Language Description

    Generic functions: C++ templates

    Template Functions

    Template Classes

    C++ Design Issues

    The Mighty Java

    Language Description

    Java Design Issues