Business and Technology Consulting Organization in Mumbai

Electronic Transformation Globally Technology Solution IT Consultancy Service Provider

Factory and Abstract Factory design pattern

Software architects generally think in terms of high-level abstractions rather than low-level programming details.
Representing a system in terms of high-level abstractions promotes understanding of the system and reduces its perceived complexity.
Abstract Factory
namespace Arindam.ETGAbstractFactory
1:{
2:
3:// Abstract factory
4:
5:abstract class AbstractFactory
6:{
7: public abstract AbstractProductA CreateProductA();
8: public abstract AbstractProductB CreateProductB();
9:}
10:
11:// Concrete factories
12:
13:class ConcreteFactory1 : AbstractFactory
14:{
15: public override AbstractProductA CreateProductA()
16: { return new ProductA1(); }
17:
18: public override AbstractProductB CreateProductB()
19: { return new ProductB1(); }
20:}
21:
22:class ConcreteFactory2 : AbstractFactory
23:{
24: public override AbstractProductA CreateProductA()
25: { return new ProductA2(); }
26:
27: public override AbstractProductB CreateProductB()
28: { return new ProductB2(); }
29:}
30:
31:// Abstract products
32:
33:abstract class AbstractProductA { }
34:
35:abstract class AbstractProductB { }
36:
37:}
38:
Factory Method
namespace Arindam
1:{
2: public class ETGFactory
3: {
4: }
5:}
6:
Singleton design patternsProxy design patternsFactory Abstract factory design patterns
MVP design patternsMVC design patternsSOA
Leave your comment.

Reduce your Dialy IT Cost, Consult with us
Stay healthy in recession

Advertisement
Sponsored by

HR Recruitment & Process Management System
Jewellery production process management software
Share
©2009 ETG Consultancy, All Rights Reserved Privacy Policy | Terms & Conditions
Asp.net, Ado.net, .Net Remoting, .Net Webservice, SQL, XML, XSLT, WCF, WPF, WWF NHibernate, Ajax, Jquery, DHTML