Creational Design Patterns in C# - Factory Pattern
Factory Pattern
Factory Pattern
In Factory design pattern, an object is created via a Factory class without specifying the actual concrete class name. It rather passes a parameter to a Factory class’s method that would indicate what concrete class the client code is interested in at run-time and then the Factory method can return the concrete class to which the parameter value maps to. (wiki)
The Factory and Builder may sound very similar in theory. However there are some fundamental difference between the two. This SO post explains the difference.
This youtube video can help you better understand Factory design pattern.
← Prev: Builder Design Pattern | Next: Prototype Pattern → |