One code smell I see often is class tests. Now, this can be done directly by calling isKindOf or isMemberOf a class or can be done more indirectly by calling respondsTo or "is" tests which are implemented for the class to return true and implemented for Object to return false. Any of these methods have the problem that they are not using polymorphism properly. After you do the test, you are going to some operation in the true case and some operation in the false case. It's actually better to take the true case and push that right into a method in the object and the false case to push it into methods in the other objects. This way, you let polymorphism do the testing for you.
Download