Overview of the Language



next up previous contents index
Next: Objects Up: No Title Previous: Contents

Overview of the Language

Theta is an object-oriented language that was developed for use within the Thor object-oriented database system [2][1], and its origins within Thor have had a major impact on its design. The requirement that code run safely inside Thor has led to the inclusion of several features, such as strong, static type checking and automatic garbage collection.

Theta is an extensible language in which users can define and implement new, abstract types and new routines. New types and routines are defined by _specifications_, which describe the interface of the new abstraction but give no implementation details; a type specification defines the names and signatures of the methods of objects of that type. Types are implemented by _classes_, and a type can have multiple implementations. Classes and routine implementations are grouped within _modules_ that encapsulate them. Modules ensure that an object or routine can be accessed only through its public interface, but allow related code to share implementation-specific information.

Theta provides separate mechanisms for type hierarchy, parametric polymorphism, and inheritance. The type hierarchy mechanism allows the definition of families of types with similar behavior; types can have multiple supertypes. The inheritance mechanism is separate from hierarchy, so that related types can have independent implementations and unrelated types can have related implementations; only single inheritance is supported. The parametric polymorphism mechanism supports generic code that is independent of the hierarchy mechanism, and does not require recompilation for different instantiations.

The characteristics of Theta are discussed further in the rest of this chapter.





theta-questions@lcs.mit.edu