Chapter 8. Data
Data can be defined as simple facts, divorced from information about what to do with them. “Data” has a dusty whiff about it, the old-fashioned ring of data processing or data structures.
Data is often a natural starting point for thinking about things. For example, we know we have a first name, middle name, and last name, so we create a Person class with that information. But objects are about data and behavior together—your code will be more robust if you organize objects by behavior.
Data-oriented objects are an opportunity. The smells in this chapter are often signs of a missing or inadequately formed class. If the data represents a good clustering, we'll usually be able to find behavior that belongs in the class.
Smells Covered ...
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