Behavioral Encapsulation
A similar set of considerations occurs with methods and subordinate objects. As the implementation of an object’s behavior grows, the size and complexity of its methods increase, leading to refactoring. This refactoring creates new methods and classes, some of which represent purely internal models of behavior within the object. The Extract Method [REF] refactoring creates restricted methods. The Extract Class [REF] refactoring creates a new representation that may not need to be seen outside of the original context.
Refactoring like this tames the size and complexity of the software. However, the very size and complexity that suggests refactoring also suggests the need for testing. We may simplify a component or unit ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access