Click here to Skip to main content
15,892,161 members
Articles / Programming Languages / C#

C#:Abstract Factory Pattern

Rate me:
Please Sign up or sign in to vote.
3.17/5 (28 votes)
18 Jun 2007CPOL 93.3K   893   21  
This tutorial describes the implementation of Abstract Factory Pattern in c#
using System;
using System.Collections.Generic;
using System.Text;

namespace OOPS
{
	public class Singleton
	{
		private static Singleton vSingleton = null;
		private static int vCount = 0;
		private Singleton()
		{
			
		}

		public static Singleton GetSingleton()
		{

			vCount++;
			if(vSingleton== null)
			vSingleton = new Singleton();
		return vSingleton;

		}

		public int CountMe
		{
			get
			{
				return vCount;
			}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
ASP.NET developer working in India.

Comments and Discussions