SCALA ROLES - A Lightweight Approach towards Reusable Collaborations
Michael Pradel, Martin Odersky · 2008
Object-orientation, programming languages, roles, collaborations, reuse, dynamic proxy 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. 1