Recently, when looking at the Android network access class found that some people use static classes to encapsulate, some people use a single case to encapsulate, suddenly found that both can be, which is the best use of it? The answer is not absolute, both of which are possible. Like abstract classes and interfaces, in fact, in many cases both ways can achieve the goal, is to see the individual understanding (abstract class and interface differences look at my other article interface and abstract class differences). Here are some views of the individual.
Static class is like the process-oriented approach and the same, is a tool class, rarely rely on other objects or resources, but in object-oriented thinking, it is necessary to use the class, rather than the process-oriented era of direct call method, so with object-oriented encapsulation of the characteristics of the method to use static class to encapsulate the methods. The singleton is a class that can be instantiated, generally with other objects or resources have a dependency on the singleton, because he can instantiate, at the same time can release resources, and so on, because in the object-oriented thinking, the instantiation is that the characteristics of each object is not the same, need to initialize, the need to occupy resources, the release is exhausted.
On the other hand, static classes are non-thread-safe, and the singleton is generally thread-safe (why is it generally?). You can refer to the article http://www.cnblogs.com/xudong-bupt/p/3433643.html your own thinking).
Static classes and Singleton differences