Method Call Bias

A method call prescribes a specific style of interaction between two objects which heavily influences the design of code. A method caller must know the identity of the object being called, but not vice versa. The caller must decide the timing of the method call, and must have its arguments on hand at that time. The target object then takes over execution until it synchronously comes up with a response, which must be a lone value.

C# has made particularly good strides to mitigate the method call bias. Asynchronous calls allow for target objects to delay their response. Actions and events allow for the calling object to trigger methods without knowing the target objects identity. And destructuring tuples allows for multiple return values.

The history of object-oriented programming includes objects which rely on message passing to communicate. If this design had taken root, the method call bias would likely have been eliminated.

See [[Method Interaction]].

#software