Monthly Archives: April 2019
Factory Method vs. the Open-Closed Principle
I was recently asked if the factory method design pattern was a violation of the open-closed principle. When you are adding a new subtype, you have to modify the factory method to enable to return additional subtypes. Also, you might be creating a new subtype for the factory method to return. Isn’t it an indication that you are violating the open-closed principles if you have to change multiple to files
Recent Comments