Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Look at here <a href="http://www.codeproject.com/Articles/14026/Generic-Singleton-Pattern-using-Reflection-in-C" rel="nofollow noreferrer">http://www.codeproject.com/Articles/14026/Generic-Singleton-Pattern-using-Reflection-in-C</a></p> <p>Sorry, :'( The road to hell is filled with good intentions</p> <p>i just want give other one simple option without entering into much detail</p> <p>Time after i also had is problem and i post that <a href="https://stackoverflow.com/questions/6000088/multi-web-services-so-multi-singleton">Multi web services so multi singleton</a> finally create my own version.</p> <p>That really work i have around to 50 internal applications and some external providers what used it.</p> <p>Well in summary After the check ideas about the singleton pattern and diferents examples done in c# i arrived to the conclusion that a good implementation is based in have internal class for create one instanced is guarantees that called to the constructor is done once time although the singleton clas is called from many threads so just have one instance</p> <p>In vb.net simplified</p> <pre><code>Public NotInheritable Class ServiceProxySingleton Private Sub New() End Sub Public Shared Function GetInstance() As ServiceProxySingleton Return NestedSingletonService._instance End Function ' Internal class Class NestedSingletonService Friend Shared ReadOnly _instance As [SingletonClass] = New [SingletonClass]() Shared Sub New() End Sub End Class End Class </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload