§2.5.(a) Using abstract classes for creation
Abstract role classes can indeed be used for object creation.
The effect of such a statement is that the team must be
marked abstract
. Only those sub-teams are concrete
that provide concrete versions for all role classes used in
creation expressions.
This includes the case, where a
super-team has a concrete role class and creates
instances of this role class and only the sub-team changes
the status of this role class to abstract. Also here
the sub-team must be marked abstract, because it contains
an abstract role class that is used in creation expressions.
Interpretation:
Since the type in a role creation expression is late-bound relative to the enclosing team instance, abstract role classes
can be seen
as the hook in a template&hook pattern that is raised from the method level to the class level:
A super-team may already refer to the constructor of an abstract role class,
only the sub-team will provide the concrete role class to fill the hook with the necessary implementation.