Authors:
Michael Pradel
1
and
Martin Odersky
2
Affiliations:
1
TU Dresden, Germany
;
2
EPFL, Switzerland
Keyword(s):
Object-orientation, programming languages, roles, collaborations, reuse, dynamic proxy.
Related
Ontology
Subjects/Areas/Topics:
Languages and Compilers
;
Object-Oriented Programming
;
Programming Languages
;
Software Engineering
Abstract:
Purely class-based implementations of object-oriented software are often inappropriate for reuse. In contrast, the notion of objects playing roles in a collaboration has been proven to be a valuable reuse abstraction. However, existing solutions to enable role-based programming tend to require vast extensions of the underlying programming language, and thus, are difficult to use in every day work. We present a programming technique, based on dynamic proxies, that allows to augment an object’s type at runtime while preserving strong static type safety. It enables role-based implementations that lead to more reuse and better separation of concerns.