Design patterns and practices in .NET: the Factory Patterns – concrete, static, abstract
September 29, 2015 23 Comments
Introduction
Factories are extremely popular among design patterns. I have never seen any reliable statistics on the usage of patterns but factories must be among the top three most used patterns. However, that is not to say that they are used correctly. Many developers misunderstand factories to factor out chunks of code to other classes where the factored-out code is encapsulated into a static method as follows:
double cost = CostFactory.Calculate(input params);