The interface of a function, method or procedure, is composed of a number of inputs and output channels, and it is important to choose the correct type of channel to guarantee the function’s contract is being met by callers.
input channels can be roughly classified as follows:
- A set of values it explicitly receives through arguments
- The state of the object or application at the time it is invoked
- Explicit return values (including, for languages that support that, “out parameters”)
- Possibly some exceptions
- A new state of the object or application after returning
- A new state of the parameters