Blog Home  Home Feed your aggregator (RSS 2.0)  
kevin Mocha - SoftwareEngineering | Design Pattern
Bookmarks collected from web.
 
 Tuesday, July 15, 2008
 Thursday, April 03, 2008

Tame Your Software Dependencies for More Flexible Apps

http://msdn2.microsoft.com/en-us/magazine/cc337885.aspx

Thursday, April 03, 2008 8:34:30 PM UTC  #    Comments [0]    |   |  Trackback
 Monday, July 23, 2007

Implementing the Singleton Pattern in C#


http://www.yoda.arachsys.com/csharp/singleton.html

Five implementations are given. The author also compared their pros and cons.

Bestone is:
public sealed class Singleton
{
Singleton()
{
}

public static Singleton Instance
{
get
{
return Nested.instance;
}
}

class Nested
{
// Explicit static constructor to tell C# compiler
// not to mark type as beforefieldinit
static Nested()
{
}

internal static readonly Singleton instance = new Singleton();
}
}

Monday, July 23, 2007 3:49:45 PM UTC  #    Comments [0]    |  Trackback
Copyright © 2008 Kevin Mocha. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: