Case Statement

Case statements are a sign that a method contains too much knowledge.

Symptoms

  • Case statements that check the class of an object.
  • Case statements that check a type code.
  • Divergent Change caused by changing or adding when clauses.
  • Shotgun Surgery⭐ caused by duplicating the case statement.

Solutions