Theo builds up. Operation "educate-cyrus" about to commence.
Theo posted a short article on singletons and difference ways to achieve them in C#. It's a good preface and shows why encapsulatin ghtat logic in something like a lazy loader can be beneficial so you dont' end writing the same boiler plate code repeatedly. However, he maes it clear that a fundamental tenet of singletons is that they are: “immutable, immutable, immutable”. However, in one of his examples he violates that contract in teh presense of standard .net functionalities like serialization. I pointed this out to him and he's going to address that issue. One things we're very inclear on is how to make the singleton pattern work outside of the context of an AppDomain or in a distributed system. I'm going ot break out my DS book to see if it has anything ot say on this issue.
Comments
- Anonymous
May 21, 2004
answer for a true Process scoped singleton:
the AppDOmain called the "DefaultDomain"... of course it depends on the initial hosting options for loading the .net runtime though... - Anonymous
May 21, 2004
Eric: Could you explain more? - Anonymous
May 21, 2004
Few typos corrected. You may delete this message at your pleasure.
--
Theo posted a short article on singletons and different ways to achieve them in C#. It's a good preface and shows why encapsulating the logic in something like a lazy loader can be beneficial so you don't end up writing the same boilerplate code repeatedly. However, he makes it clear that a fundamental tenet of singletons is that they are: “immutable, immutable, immutable”. However, in one of the examples he violates that contract in the presence of standard .net functionalities like serialization. I pointed this out to him and he's going to address that issue. One of the things we're very uncertain on is how to make the singleton pattern work outside of the context of an AppDomain or in a distributed system. I'm going to break out my DS book to see if it has anything to say on this issue.
--