Posted on Wednesday December 3, 2008

C# Design Patterns: the Factory pattern


One class (the factory) creates instances of other classes which all implement the same interface or subclass a specific class. The factory optionally calls the method(s) of the instance it creates.

Example usage

Plugin architecture (implemented alongside reflective loading of types) is one good usage of the Factory design pattern.