Abstract Factory Pattern is type of Creational pattern . This is used to create objects of related class without specify concrete class.
Abstract Factory has :
1) Abstarct Factory - declares an interface for operations that create abstract product objects.
2) Concrete Factory - implements the operations to create concrete product objects.
3) Abstract Product - declares an interface for a type of product object.
4) Concrete Product - defines a product object to be created by the corresponding concrete factory. It implements the Abstract Product interface.
5) Client - uses only interfaces declared by Abstract Factory and Abstract Product classes.
Showing posts with label Design Patterns. Show all posts
Showing posts with label Design Patterns. Show all posts
What is singleton design pattern ?
Singleton design pattern is type of Creational Design pattern . It creates a single instance object which caters to all the clients.
Singleton Design pattern has :
public sealed class Singleton
{
// private constructor
private Singleton()
{
}
// static readonly member
static readonly Singleton instance = new Sinleton();
// static instance property
public static Singleton Instance
{
get { return instance ; }
}
}
Singleton Design pattern has :
- It has private constructor so that instance of class cannot be created anywhere but inside its own methods.
- It has static read only member so that instance is created only once .
- It has an instance property to return singleton object instance
public sealed class Singleton
{
// private constructor
private Singleton()
{
}
// static readonly member
static readonly Singleton instance = new Sinleton();
// static instance property
public static Singleton Instance
{
get { return instance ; }
}
}
Subscribe to:
Posts (Atom)
Popular Posts
-
Stored Procedure vs Function Stored procedure cannot be executed using SQL Select command whereas Function (UDF) can be executed using SQL ...
-
SSRS stands for SQL Server Reporting Services . SSRS is server based reporting platform. It provides reporting functionality from different ...
-
Criteria BasicHttpBinding WsHttpBinding Security support This supports the old ASMX style, i.e. WS-BasicProfile 1.1. This exposes web ser...
-
Database Connection - Datereader requires an open database connection whereas Dataset does not require an open database connection Namespa...
-
IIS provides a variety of authentication schemes: • Anonymous (enabled by default) - Client does not provide any credetials • Basic - ...
-
Different types of diagrams in UML : UseCase diagram Class diagram Object diagram State diagram Sequence diagram Collaboration diagram...
-
Extents are basic unit in which space is allocated to tables and indexes. Extent is eight contiguous pages i.e 64 KB.
-
Normalization is a method to seperate data into multiple tables and relate these multiple tables. Some benefits of normalized database : 1)...
-
Refer below code to understand : using System; delegate void DelMethod(int x); // This is the delegate declaration // Example is Class c...
-
Authorization is used to determine whether user has access to resource or not. There are two ways to authorize a resource : File authoriza...