Update after some comments: this post is not a discussion whether to use Singleton or not. It’s not a discussion on why Singleton might be an anti-pattern. It’s just an example on an alternative implementation of Singleton in Java. Just that.
There are two classic ways to implement Singleton pattern in Java: public final instance field [...]
Archive for August, 2008
Singleton in Java – the proper way
Posted in Java, Software development, tagged enum, Java, pattern, serialization, singleton on 2008-08-06 | 23 Comments »