next up previous contents
Next: ValuesObjects, Classes and Up: No Title Previous: Introduction

Overview

  SATHER-K is an imperative, object-oriented language. A program text consists of class declarations which serve as possibly parametrized type templates for objects. Class declarations define classes, i.e. sets of features, i.e. attributes and methods. The values of the attributes make up the state of objects of the class. The methods define operations applicable to such objects and their attributes.

SATHER-K considers all attributes to be private to the object to which they belong. Whenever an attribute is to be accessed from outside then this access is replaced by a method call for reading or writing the attribute value. The corresponding methods are automatically supplied by the implementation. Thus, a class defines an interface for its objects which consists of methods only.

Within the language the name space of classes is flat. Modules consisting of several class declarations may be formed by help of SATHER-K's configuration manager, a tool which provides flexible information hiding also for class names.

The execution of a SATHER-K-program therefore consists of creating a number of objects which then may call their own or other object's methods. The state of the computation at any time is given by the state of all the objects.

Class declarations are either parametrized or simple; in the latter case they correspond one-to-one to classes. Parametrized classes especially serve for constructing data structures in which the type of the elements or other properties which are not of primary concern can be specified separately. This feature is one of the key issues when constructing reusable libraries.

Classes may be inherited, i.e. the declarations which make up the body of the class are literally copied into a subclass. SATHER-K allows for multiple inheritance, i.e. there might be more than one class which is inherited by the same subclass. For simplifying matters we always call a class a subclass of itself.

In SATHER-K inheritance is available in two forms: Include inheritance copies all or some of the declarations of a class into a subclass; it corresponds to simple code reuse. Subtype inheritance additionally requires that the subclass conforms to the superclass: It must be possible to use the features of a subclass and its objects in all contexts where the superclass would be admissible.

Subtyping is the basis for polymorphic feature access. There are two kinds of types available for attributes and local entities of methods: By normal or monomorphic types T we declare entities whose values always carry the same type. By polymorphic types $T we declare entities a whose values may carry any type conforming to T including T itself; whenever a feature x of a is accessed then it is selected according to the type of the current value of a. This polymorphic access is also called dynamic dispatch.

SATHER-K is statically type safe: It is possible to statically check that no access to an object and no method call will result in a typing error at run-time.



next up previous contents
Next: ValuesObjects, Classes and Up: No Title Previous: Introduction

Martin Trapp
Mon Feb 17 16:49:16 MET 1997