Delegation

Generalization/Specialization is a powerful concept. But despite seeming to be a natural abstraction, its semantics are indeed counter-intuitive and may lead to serious problems. A specialization relationship such as Student is_a Person seems to be perfectly valid. However, it does neither reflect the possibility that this relationship may be variable over time nor the fact that a Student as a role has a different nature than a Person describing a human.

Delegation provides a solution to these limitations. From a conceptual perspective it is based on roles and role fillers. A role requires a role filler to perform its duties. From an implementation perspective, delegation means to transparently dispatch method invocations to the role filler where the role alone cannot perform those. When the runtime environment tries to invoke a method on the role, it detects that the role cannot do so and forwards the invocation onto the role filler which then performs it and returns the result back to the role.

Delegation is sometimes distinguished from forwarding by the fact that either self relates to the object that serves as a role filler or self relates to the object that serves as a role. From a conceptual perspective, the first case is clearly more relevant. The implementation of delegation in the XModeler reflects the first case.

Links:
ICB Report 53:
Thoughts on classification / Instantiation and generalisation / Specialisation (Ulrich Frank)

The many faces of inheritance: A taxonomy of taxonomy (Bertrand Meyer)

Do We Need Inheritance? (Wolfgang Weck, Clemens Szyperski)