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 the main difference between Asp.net and Vb.net?

561


What is a nested masterpage in asp.net 2.0? Can there be a master page inside a masterpage?

500


What is the differences between a primary key and a unique key in sql server?

531


Which platform does Microsoft .NET use for exchanging data between applications?

578


Any disadvantages in Dataset and in reflection ?

2820






What is difference between session and cookies?

540


how to implement some securty aspect in our application i.e 1.cookie poisioning. 2.data encryption. 3.forcefull browsing 4.sql/code injection 5.securing web app by using web services ........my question is how to implement these thing in our application is this done by hard coding or by help of some tool

1638


What is .net remoting?

565


What’s difference between “optimistic” and “pessimistic” locking?

575


How can you enable impersonation in the web.config file?

554


Differentiate between file-based dependency and key-based dependency.

509


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

561


What is a web farm?

590


Explain the overview of asp.net?

558


Explain the difference between sql invalidation and sql notification.

551