October 2013
Intermediate to advanced
368 pages
9h 20m
English
We could consider a WAV snippet, or possibly a WAV snippet writer, as an abstraction of its own. The name of our primary class, WavReader, already suggests that anything to do with writing snippets is an inappropriate responsibility. Further, we are making extensive changes to the snippet logic and want to isolate the changes to a class with smaller scope.
As a short-term Mikado Goal, we want to extract the
writeSnippet
function into its own class, Snippet. Once we complete the immediate goal, we plan to clean the Snippet code considerably. One goal at a time, however.
Given the space constraints of a book, this is a smaller example, but it’s no less real than your regular refactoring challenges. It’s also ...