According to Are there guidelines on how many parameters a function should accept?, it is ok for a method to have few parameters.
According to https://stackoverflow.com/questions/11240178/what-is-the-gain-from-declaring-a-method-as-static/11240227#11240227, if a non-static method doesn't rely on any non-static members, it is better be static.
How about the case that a method just use a few non-static members? For example:
public class MyClass{
private String userId;
private String name;
.
.
.
public void callSomeAPI(){
.
.
.
String url=...+this.userId+...;
//other code
}
}
callSomeAPI() doesn't need to override, but it can't be static currently just because it needs
this.userId
only. So my question is, is it worth to convert the non-static members into parameters, i.e.:
public void callSomeAPI(String userId){
.
.
.
String url=...+userId+...;
//other code
}
if it needs very few non-static members only?