Geeks With Blogs

News


Alois Kraus blog September 2006 Entries
Lazy Vs Eager Init Singletons / Double-Check Lock Pattern
.cf { font-family: courier new; font-size: 10pt; color: black; background: white; } .cl { margin: 0px; } .cb1 { color: blue; } .cb2 { color: teal; } Singletons are the easiest programming pattern to learn which seems to be the reason why it is often used in places where it is inappropriate. They are very straightforward to implement and understand. Just create a static field and return the static instance in a public get property. A Logger Singleton is a classic example of this pattern: public class ......

Posted On Sunday, September 10, 2006 8:36 PM

Copyright © Alois Kraus | Powered by: GeeksWithBlogs.net | Join free