Singleton Design pattern?How do you achieve it?

Answer Posted / mithun kanungo

We Can Achieve Singleton Design Pattern By restricting Other
Class To Make Object of the class By Using Constructor
instead we can Use A Static Method to get hold of the
Instance of the class , And By making our Constructor
private we can Restrict other classes to make Instance of
the Class , So that All other Classes use the same static
method to make only one instance of the class.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is session and cookies in asp.net?

759


Which type of state management is provided by Query String in ASP.NET?

786


What is Razor View Engine

829


What is fulltrust?

780


What is a web farm?

768


Explain the difference between singleton and single call?

756


What is the difference between exe and dll?

809


what is loosely coupled solution? How it can be used?

781


What are the various types of cookies in asp.net?

764


Define viewstate in .net?

731


1.What r collections? 2.What is .pdb file? 3.Is it possible to provide access to users in master page? 4.What is dirty n Phantom Read(SQL)? 5.What r different isolation levels(SQL)? 6.How to set authentication mode in web.config file?

2043


How can we identify that the Page is Post Back?

741


What is the difference between client-side and server-side validations in ASP.NET?

896


Is asp.net free?

761


Where sessions are stored?

874