Hi Jiří!

I hope you enjoyed my article and thanks for taking the time to write a response. It’s much appreciated :)

It’s a factory that adheres to the Open/Closed principle.

So, let’s say you implement a factory using switch or if-else.
How do you extend it? If the answer is adding another if-else or extra case, you’ve got yourself into a lot of trouble. Unless it’s a stupid simple application of course.

Written by

Tech writer with 621K+ views. Sharing my opinion and what I learn. Danish C# backend engineer in FinTech. Ex Big4 senior tech consultant.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store