Design Patterns with C#

 

Creational Patterns

Singleton

// Declare a singleton instance
private static SingletonClass instance;
// Hide constructor
protected SingletonClass(){
}
// Construct singleton instance
public static SingletonClass Instance(){
if (instance == null){
instance = new SingletonClass();
}
return instance;
}

Behavioral Patterns

Structural Patterns

References

* http://sourcemaking.com/design_patterns
* http://www.dofactory.com/Patterns/Patterns.aspx#list

This entry was posted in architecture. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.