I have class that handles HTTP requests:
public final class RestHttpClient {
/*there is no fields*/
/**
* @param mhttp - HTTP request that need to send
* @return HttpResponse, that contains information about server response
*/
public HttpResponse sendRequest(final HttpRequestBase mhttp) throws IOException {
/*do stuff and get response from server*/
return response;
}
/*there a few more helpful methods*/
}
For the one hand - there is no need in instance of class, so I can use static methods. But for another hand singleton looks more reusable. So, I'm not sure which way to choose.
What is more readable and reusable? Static or singleton? Or should I just don't care about it and allow user to create instance of class?