-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: SitaramanM
Message 5 in Discussion

Hey rosh   was just wondering why do you need the get function at all for a singleton. 
 Agreed in the pre .Net world we needed to have a private member and a public static 
method which does lazy initalization and all that double-check locking.   But in the 
.net space  all i need to  code for creating a singleton is this :   sealed class 
Singleton 
{
    private Singleton() {}
    public static readonly Singleton Instance = new Singleton();
}   Isnt it??  Now this will give me a singleton(all the plumbing work is done away 
with...).  Coming back to your question, if you look at the above code snippet, i 
think it will reiterate my belief that it is only the static qualifier which will have 
any say on the lifetime of the object.   What do you think?   regards,   sr

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to