Reverse inheritance in statically typed object-oriented programming languages (original) (raw)
Related papers
Reverse inheritance: Improving class library reuse in Eiffel
2007
Reusing Eiffel class libraries can be problematic. Modifying the existing source code of classes, if is available and is not copyrighted, involves maintaining the entire class library. Reverse inheritance class relationship offers several facilities for reorganizing Eiffel class hierarchies: creating a common superclass, factoring common features, inserting a class into an existing hierarchy. Using a new class relationship similar to ordinary inheritance with a symmetrical semantics will guarantee the expresiveness of the new class design without changing the original source code of the reused classes.
Towards Fully-fledged Reverse Inheritance in Eiffel
Generalization is common in object-oriented modelling. It would be useful in many situations also as a language mechanism, reverse inheritance, but there have been only few detailed proposals for that. This paper defines reverse inheritance as a true inverse of ordinary inheritance, without changing anything else in the language that is extended. Eiffel is perhaps the most suitable language for that purpose because of its flexible inheritance principles. Moreover, there exists good previous work on Eiffel, on which we have built. We describe the most important aspects of our extension, whose details proved to be more difficult than we had assumed. It would be easier if some modifications were made to Eiffel's ordinary inheritance, or if one designed a new language.
New Perspective To Improve Reusability in Object-Oriented Languages
The Journal of Object Technology, 2006
Object-oriented languages provide insufficient answers regarding reuse of hierarchies of classes especially because mechanisms provided for separating application concerns are not sufficient. We propose to extend object-oriented languages, Java in the current implementation, to address this particular issue. The model, inspired by approaches dedicated to the separation of concerns, introduces a new concept called adapter. It enables to specify the composition protocol of a hierarchy of classes independently from the context of use. This composition protocol allows the programmer to benefit from the necessary guidance and controls when the adapter is customized to be integrated into applications. 1 This is the term used in UML to deal with the various kinds of class.
A Complete Inter-Class Sharing During the Inheritance to Enhance Reusability.pdf
Inheritance is used for reusability in an object oriented programming language. The complete reusability is not possible with the simple inheritance process. On inheriting parent class, the child does not get a complete access to the inherited data. Only an instance of the values of inherited data has been accessible by the child class and it is true even for the public data. The present communication is a concept paper in which a special inheritance method has been conceptualised. This proposed method is called backward accessibility inheritance. Once inherited, the public data item of the parent class can be shared by the child class in all sense. This way the inherited data item can be truly reused by child class in terms of memory space, name and value. To control the accessibility of the data during the backward accessibility inheritance, concept of dominance has also been introduced.
Towards a Reengineering Tool for Java based on Reverse Inheritance
2006
The reverse inheritance class relationship has several potential uses. It can be exploited as a mechanism integrated in one of the object-oriented programming languages or as a mean for reengineering class hierarchies in order to obtain locally adapted software releases. The limited local adaptations and restricted enhancements can be encapsulated in the superclass of the reverse inheritance class relationship and using a software tool they can be applied automatically to each software release. The implementation of the software tool works on Java class hierarchies.
Objects and polymorphism in system programming languages: a new approach
Periodica Polytechnica Electrical Engineering, 2007
A low-level data structure always has a predefined representation which does not fit into an object of traditional objectoriented languages, where explicit type tag denotes its dynamic type. This is the main reason why the advanced features of object-oriented programming cannot be fully used at the lowest level. On the other hand, the hierarchy of low-level data structures is very similar to class-trees, but instead of an explicit tag-field the value of the object determines its dynamic type. Another peculiar requirement in system programming is that some classes have to be polymorphic by-value with their ancestor: objects must fit into the space of a superclass instance. In our paper we show language constructs which enable the system programmer to handle all data structures as objects, and exploit the advantages of object-oriented programming even at the lowest level. Our solution is based on Predicate Dispatching, but adopted to the special needs of system programming. The techniques we show also allow for some classes to be polymorphic by-value with their super. We also describe how to implement these features without losing modularity.
Empirical assessment of object-oriented implementations with multiple inheritance and static typing
Object-oriented languages involve a threefold tradeoff between runtime efficiency, expressiveness (multiple inheritance), and modularity, i.e. open-world assumption (OWA). Runtime efficiency is conditioned by both the implementation technique and compilation scheme. The former specifies the data structures that support method invocation, attribute access and subtype testing. The latter consists of the production line of an executable from the source code. Many implementation techniques have been proposed and several compilation schemes can be considered from fully global compilation under the closed-world assumption (CWA) to separate compilation with dynamic loading under the OWA, with midway solutions. This article reviews a significant subset of possible combinations and presents a systematic, empirical comparison of their respective efficiencies with all other things being equal. The testbed consists of the PRM compiler that has been designed for this purpose. The considered techniques include C++ subobjects, coloring, perfect hashing, binary tree dispatch and caching. A variety of processors were considered. Qualitatively, these first results confirm the intuitive or theoretical abstract assessments of the tested approaches. As expected, efficiency increases as CWA strengthens. From a quantitative standpoint, the results are the first to precisely compare the efficiency of techniques that are closely associated with specific languages like C++ and EIFFEL. They also confirm that perfect hashing should be considered for implementing JAVA and .NET interfaces.