Singleton Pattern

Nesnenin her cagrımında tek instance olması için kullanılan pattern..

///singleton
public class Singleton
{
public static Singleton uniqueInstance;
private Singleton() { }
public static Singleton GetInstance()
{
if (uniqueInstance == null)
{
uniqueInstance = new Singleton();
}
return uniqueInstance;
}
}

18 Mart 2007 Pazar 10:26 gönderen MuratHAKSAL
Filed Under: , ,

Yorumlar