thank you Eugen Klass for reading the blog and leaving a comment.

Yes, we can use factory design pattern if required. The point of the blog was to make user class avoid if/else

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine

Love podcasts or audiobooks? Learn on the go with our new app.