Thursday, May 11, 2017

What is difference between Factory and Abstract factory design pattern?


Try to understand the two design patter with some simple examples factory design pattern:

You have some raw materiel (Input) , you provided it to one factory (factory class) and the factory gives you a product (object) so based on your raw material and factory implementation you get a product this is a simple illustration of factory design pattern


Now for the Abstract factory design: It’s like you have raw material, you provided it to one factory as input but instead of processing your input this factory delegates the task to create product to its sub factories. 

So simply, an abstract factory means multiple factories.

No comments:

Post a Comment

Implementing Service Locator (To Resolve Dependency)

using System; /// <summary> /// Summary description for Class1 /// </summary> public class serviceLocator {     public s...