S
Stefan Ram
Thanks for your helpful answer! I might still continue to
use »accept« sometimes, but I see your point.
It might have to do with the following aspect:
The contract of the object O says:
»Before the other methods of O can be
used, the method
acceptRunnable( java.lang.Runnable )
has to be called once with an object
implementing java.lang.Runnable.«
(Similar contracts apply often to the
classes I write in such cases.)
Nowhere does the contract say that a
»property Runnable« exists or is set.
A perfectly fine implementation of
»acceptRunnable« might be:
public void acceptRunnable( final java.lang.Runnable runnable )
{}
The client cannot observer what the object actually does
with the runnable object. Therefore, »setRunnable« might not
be an appropriate name for such a method.