Multiple Inheritance and Type System Design

نویسنده

  • Andrew P. Black
چکیده

It is now widely accepted that inheritance is not subtyping [5], and that ‘‘inheritance is a relationship between implementations, while conformity is a relationship between interfaces’’ [1]. But like most maxims, these two are something of an oversimplification. Inheritance: Mechanism or Relation? As realized in Simula and Smalltalk, inheritance is a mechanism for generating new pieces of program from old pieces of program. As such it is of tremendous value to those who write programs (as opposed to those who write papers). In contrast, subtyping is a relation between objects; whether or not one object’s type conforms to another object’s type depends on the interface of those objects but not on the code that created them. In this sense it is obvious that inheritance is not subtyping. But in a wider sense, inheritance gives rise to a relation that is similar to subtyping. Following Bruce[2] we will call this relation inh; figure 1 shows how inh is related to inheritance. Suppose that we have a piece of program A from which we construct through the mechanism of inheritance another piece of program AB. As Cook [4] has shown, A and AB must be thought of not as classes, but as class generators, i.e., as functions from classes to classes. In programming language terms, this means that A and AB

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Typeful Approach to Object-Oriented Programming with Multiple Inheritance

The wide practice of objected oriented programming (OOP) in current software practice is evident. Despite extensive studies on typing programming objects, it is still undeniably a challenging research task to design a type system that can satisfactorily account for a variety of features (e.g., binary methods and multiple inheritance) in OOP. In this paper, we present a typeful approach to imple...

متن کامل

Eliminating Cycles in Composed Class Hierarchies

Multiple class hierarchies can be used each to represent a separate requirement or design concern. To yield a working system, these disparate hierarchies must be composed in a semantically meaningful way. However, cycles can arise in the composed inheritance graph that restrict the space of composable hierarchies. This work presents an approach to eliminating these cycles by means of separating...

متن کامل

A Generic Computer Algebra Library in Oberon

It is discussed how generic computer algebra algorithms can be implemented in an existing general−purpose programming language as a well encapsulated library. We show the advantages of such an approach and explain the key issues of an existing implementation in Oberon. One of the most important design issues −the type hierarchy −is explained. The implementation relays on Oberon's type system be...

متن کامل

The Design of Monty: a Programming/Scripting Language

This paper describes the design of Monty, a language intended to be equally suitable for both scripting and conventional programming. Monty features an unusually flexible type system in which all values are viewed as objects in a single-inheritance class hierarchy, static and dynamic typing are smoothly integrated, and both nonvariant and covariant generic classes are supported. An interesting ...

متن کامل

Inheritance in Programming Languages

Inheritance is a powerful concept employed in computer science, especially in artificial intelligence (AI), object-oriented programming (OOP), and object-oriented databases (OODB). In the field of AI, inheritance has been primarily used as a concise and effective means of representing and reasoning with common-sense knowledge (Thirunarayan, 1995). In programming languages and databases, inherit...

متن کامل

Multiple Inheritance via Intersection Types

Combining intersection types with higher-order subtyping yields a typed model of object-oriented programming with multiple inheritance. Objects, message passing, subtyping, and inheritance appear as programming idioms in a typed-calculus, a modelling technique that facilitates experimentation and helps in distinguishing between essential aspects of the object-oriented style |encapsulation and s...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2002