- Smells Covered
- Comments
- Long Method
- Large Class
- Long Parameter List
- More Challenges
- Conclusion
More Challenges
EXERCISE 7
Smells and Refactorings.
Consider these smells:
-
Comments
-
Large Class
-
Long Method
-
Long Parameter List
For each refactoring in the following list, write the letter for the smell(s) it might help cure:
-
___ Duplicate Observed Data
-
___ Extract Class
-
___ Extract Interface
-
___ Extract Method
-
___ Extract Subclass
-
___ Introduce Assertion
-
___ Introduce Parameter Object
-
___ Preserve Whole Object
-
___ Rename Method
-
___ Replace Parameter with Method
EXERCISE 8
Triggers.
Consider the smells described in this chapter (Comments, Large Class, Long Method, Long Parameter List).
-
Which of these do you find most often? Which do you create most often?
-
To stop children from sucking their thumbs, some parents put a bad-tasting or spicy solution on the child's thumb. This serves as a trigger that reminds the child not to do that. What triggers can you give yourself to help you recognize when you're just beginning to create one of these smells?