One advantage of a singleton class is that you can combine it with a class factory (and interfaces). By restricting the creation of the singleton to the factory, you can change what instance is actually created when the situation warrants it. For example, let's say you have an application that needs access to a particular business workflow. The first version can be a POJO (plain old
Java object). Later on, you need to access the workflow on a separate server through a web service. The only change you will have to make is, in the class factory, change from creating the POJO to creating an instance of an object that calls the web service. Your client will not need changing.
With the class factory
pattern, you can even support both versions. For example, if your application must work "online" and "offline", the factory can decide which version to use depending on whether it can establish a connection to the remote server.