Remove Subclass

refactorgram

class Person {
  get genderCode() {return “X”;}
}
class Male extends Person {
  get genderCode() {return “M”;}
}
class Female extends Person {
  get genderCode() {return “F”;}
}

image/svg+xml

class Person {
  get genderCode() {return this._genderCode;}
}

inverse of Replace Type Code with Subclasses

aliases Replace Subclass with Fields