I would ask the question a little differently, because need offers a cost that is not relevant. I do not think that it is really important if it is used only for one or several methods.
When you make multiple calls to an instance , how does a parameter of type <change :
- If the constant is after the instance instance, you parameterize the entire interface.
- if it may be different for each call, you parameterize the method.
Thus, the type of the parameter actually gives information about the code, improves the meaning and clarity.
Edited : Example
If sometimes the type parameter changes from call to call, for the same instance ...
It must be a parameter of the method.
source share