Find Missing Abstractions
Learn about missing abstractions and duplication of structure.
We'll cover the following...
Duplication of structure
Duplication of structure often means there’s a missing abstraction, which in Ruby generally means we can move some code into a new class.
One symptom is a set of instance attributes that are always used together, especially if the same group of attributes is being passed to multiple methods. The use of a common set of variables often indicates that we want a new class with those friendly attributes as the instance attributes.
Another common symptom is a group of methods that all share a prefix or a suffix, such as logger_init
, logger_print
, and logger_read
. Often this means we need a class corresponding to the common ...