Christian Tietze

  • Blog Posts
  • Writing
  • Apps
  • Work With Me
  • Contact

Use Double-Dispatch and Polymorphism to Get Rid of Conditionals

Feb 9th, 2015

I want to point out a particular refactoring Jimmy Bogard shows in his video I mentioned last time. Jimmy transforms a switch statement into a double-dispatch method call, making use of good old polymorphism to deal with variety of options. We’ll see what these terms mean when applied.

Continue reading …

  • ∞ Permalink
  • • Comments
  • • Tags:
    • polymorphism
    • domain-model

Contact • Newsletter • Blog Feed • /feeds • /now • /uses • @ctietze@mastodon.social • Privacy & Legal Information

Except where otherwise noted, content on this site is licensed CC BY-SA 4.0.

As an Amazon Associate I earn from qualifying purchases. This e.g. applies to links to Amazon.com.