<< §4.2.(c) Replacing composition | ↑ Table of Contents ↑ |
§4.2.(d) Callin methods
Role methods to be bound by a callin replacement binding must have
the modifier callin
. This modifier is only allowed for methods
of a role class.
A method with the callin
modifier can only be called
- via a callin replace binding
- by a
super
ortsuper
call from an overriding callin method.
It is illegal for a callin
method
- to be called directly,
- to be bound using a callout binding, and
- to be bound to a base method using a
before
orafter
callin binding.
Despite these rules a second level role — which is played by the current role — can intercept the execution of a callin method using any form of callin binding.
A callin method cannot override a regular method and vice versa, however,
overriding one callin method with another callin method is legal and
dynamic binding applies to callin method just like regular methods.
A callin method must not declare its visibility using any of the modifiers public
,
protected
or private
. Since callin methods can only be invoked via callin bindings
such visibility control would not be useful.
<< §4.2.(c) Replacing composition | ↑ Table of Contents ↑ |