Date[ June 18, 1998] Recordnr[ ] Stored[ Who[ Michael VanHilst (works now at HP-Labs), D. Notkin Title[ Using Role Components to Implement Collaboration-Based Designs Published[ OOPSLA 96 Keywords[ aspect-oriented programming, roles, collaborations, roles as code entities Comment[ nice idea, might become an additional implementation paradigm, compareable to model-view-controller Summary[ Problem statement: Collaborations are modelled in the design. They show interactions between different roles (not really between different classes)==> collaborations as collections of roles. A role specifies a part of a single object that participates in a particular collaboration. One class can play several roles in differing collaborations; the same role is not implemented by the same class throughout all applications using that collaboration pattern. How could the notion of roles brought over to the implementation? Code reuse, system evolution: Collaborations in the design are derived from use-case-like scenarios in the requirements analysis. By having role-entities in the code, these use-cases could be reflected directly in the code, preserving this complementary view to the static class view. How? Inheritance is a logical glue for composing roles into classes, but: - inheritance must be delayed until whole composition and order of composition is known (compile-time, not code-writing time) - bindings to types must be delayed as well, so that roles can be coded independant of the specific classes taking them on, and thus be reused ==> class template for each role that is parameterized by each of the collaborator and by the class taking on the role itself ==> class then extend these templates, replacing the collaborators by the actual classes ==> a class having several roles is extended several times, each time the higher level class becomes a parameter in the next template to be extended ==> inheritance chain (but only simple inheritance is used) In order to get the right order in the inheritance chain, a roles/responsibility matrix is made. It helps to determine which roles (object methods) extend each other, and thus should override each other by calling the original one in case not the extended one is used. Related concepts: subject-oriented programming mixins