kirancodes.me
To Proof Maintenance & Beyond!

Rule-Based Delegation for Prototypes

Jay Almarode

Abstract

Arguments have been given recently for providing the functionality of prototypes in object-oriented languages. Prototypes allow more flexible sharing of code and data by delegating messages to parent objects without the rigid structure of a class hierarchy. Prototypes can implement classes, and delegation can be used to model both single and multiple inheritance. However, one drawback with delegation is the difficulty in enforcing the semantics that delegation is used to model. This paper proposes a novel mechanism to control the delegation of messages with rules. In this system, the delegation of messages is governed by a set of rules possessed by each object. Rules can be used to implement classical single inheritance and can implement various solutions to multiple inheritance. In addition, rules can be created dynamically to model application-specific semantics. This paper describes how rule-based delegation works and illustrates various rules for rule-based delegation that have been implemented.

Related papers