Ultimamente tenho lido que o "Anti-Pattern" Singleton pode ser substituído por Injeção de Dependências.
Procurei por um exemplo simples porém, não encontrei.
class Singleton() {
private static String instance = null;
private Singleton() // private Construtor
{
}
public static String getInstance()
{
if(instance == null)
{
instance = //get something
}
return instance;
}
Att.