Is there any reason why business service classes(stateless) are designed as singletons(just once instance in the application). If the business service is stateless it could be designed as a static class as well. Can someone share some information on why it has been designed as a singleton please? What advantage does a singleton class has over the static class?
Thank you for your response Jeanne. I meant class with full of static methods. Is there any difference between a class with full of static methods and a singleton class where only one instance exists per JVM. In my project service classes and DAO classes are singletons, why cant they be static methods in a class?
A class with all static members is usually called a utility class. The idea of utility classes is to contain functions or constants for the use of other code. A utility class wouldn't therefore be much use for a DAO because all the data would be predetermined in the class.