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

How can we provide the WebParts control functionality to a server control?

784


What is AutoEventWireup attribute for ?

806


What is authorization in asp.net?

818


Is data edited in the Repeater control?

813


What are the event handlers that we can have in global.asax file?

754


What are the advantages and disadvantages of session?

895


Explain server-side scripting and client-side scripting.

716


Explain Features in ASP.NET

822


What are different types of api?

785


What is the use of execute non query in asp.net?

715


what are configuration files?

770


How many languages are supported by .NET at present time?

568


What are the types of session in asp.net?

733


Does asp.net still recognize the global.asa file?

756


Diff between web user control and web custom control?

757