Lecture
All these smells are an incomplete or incorrect use of object-oriented programming features.
Switch statements
You have a complex switch statement or a sequence of ifs.
Temporary field
Temporary fields are fields that the object needs only under certain circumstances. Only then they are filled with some values, remaining empty the rest of the time.
Waiver of inheritance
If the subclass uses only a small fraction of the inherited methods and properties of the superclass, this is a sign of the wrong hierarchy. In this case, unnecessary methods can simply not be used or be redefined and throw exceptions.
Alternative classes with different interfaces
Two classes perform the same function, but have different method names.
Comments
To leave a comment
Refactoring theory
Terms: Refactoring theory