Hi Björn,

Thanks for reading my article. It’s much appreciated :)

True, it’s not the responsibility of the repository to do all that work.

But, it’s beside the point of this article. I didn’t want to go thru every architectural layer just to show how if-else can be replaced by polymorphic execution.

Ideally, you’d want to have a command object and command handler, where the command handler takes the repository as a dependency.

Software Developer Manager | Big4 ex. FinTech | Writer with +1M views. Sharing my opinion & what I learn. YT channel youtube.com/c/NicklasMillard

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

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