design_patterns_in_typescript
design_patterns_in_typescript copied to clipboard
rewrite factory_method
If I want to add ConcreteProductC, I have to modify ProductFactory . This will break the Open-Closed Principle. So, I suggest rewriting factory_method like my pull request. We can add any ConcreteProduct,but not modify ProductFactory .