Alois Kraus
blog
Site Sections
Home
Contact
Syndication
Login
Posts
69
Comments
233
Trackbacks
162
C# Programing
Lazy Vs Eager Init Singletons / Double-Check Lock Pattern
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: .cf { font-family: courier new; font-size: 10pt; color: black; background: white; } .cl { margin: 0px; } .cb1 { color: blue; } .cb2 { color: teal; } public class...
Share This Post:
Posted On
Sunday, September 10, 2006 8:30 PM
|
Feedback (10)
Why .NET Tracing is not reliable
This time I wanted to write something about the .NET Framework that is solved not optimal of the .NET Framework. My unsuspecting victim is the well known System.Diagnostics.Trace class. Static classes have the big plus that they are easy to use but they can be very hard to maintain if you want to extend it (no derivation) and have a lifetime problem with the objects that are created inside it. The Trace facade is in my opinion a prominent example of how you should not design a reliable static facade...
Share This Post:
Posted On
Monday, June 12, 2006 9:11 PM
|
Feedback (9)
Article Categories
Patterns and Practices
C# Programing
Archives
December, 2011 (3)
September, 2011 (1)
August, 2011 (4)
July, 2011 (1)
June, 2011 (2)
March, 2011 (1)
November, 2010 (1)
July, 2010 (3)
June, 2010 (5)
May, 2010 (2)
April, 2010 (1)
March, 2010 (2)
February, 2010 (1)
December, 2009 (1)
November, 2009 (1)
October, 2009 (2)
September, 2009 (1)
June, 2009 (1)
May, 2009 (2)
December, 2008 (3)
November, 2008 (1)
May, 2008 (1)
April, 2008 (2)
January, 2008 (1)
November, 2007 (1)
February, 2007 (1)
January, 2007 (1)
October, 2006 (1)
September, 2006 (1)
August, 2006 (1)
July, 2006 (1)
June, 2006 (2)
May, 2006 (4)
April, 2006 (3)
March, 2006 (1)
February, 2006 (3)
January, 2006 (3)
December, 2005 (2)
November, 2005 (1)
Post Categories
General C# Programming
Enterprise Library
Physics
Non Work
F#
Performance
Image Galleries
Enterprise Library
C#
Personal
Programming
Rico Mariani: CLR Performance Guru
Copyright © 2005 Alois Kraus
This work is licensed under a
Creative Commons License