Replace Type Code with Class
A class has a numeric type code that does not affect its behavior.
Replace the number with a new class.

For more inforamtion see page 218 of Refactoring
Corrections
Privitizing the accessors for the type code
At the end of the refactoring I said that you could make those methods that use the type code, eg getCode(), private. I neglected to say that you first have to find the callers of those methods and change them to no longer use the code number.
Contributors
- Randy Coulman