Hi Barend,

Thanks a lot for taking the time to read my article! It’s much appreciated :)

Most factories I’ve encountered are implemented with switch or if-else.

I also mention the option of using reflection. That’s actually the common way I do it at client projects. But, as not every language has great reflection capabilities as C# does, I left it out.

The factory created here can be implemented in most OO languages I’d assume.

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