2 Data, Identity, and Values
This chapter covers
- Identity and change
- Values and Value Objects
- What “Data as Data” means
- Modeling data with Records
In the first chapter, we started to look at the effect that representation has on our programs as a whole. Each choice we make ripples outward (either spreading good effects or ill depending on our modeling choices). By really focusing on what something in our domain is - what it represents -- we were able to use that understanding to radically simplify our code as a whole. There's another question we have to ask when we’re taking our first steps with data-oriented programming. It’s a bit more fundamental, but holds equal powers to reshape how and what we program with. It’s a little casual metaphysical question that goes like this: what does it mean to be something?
Programming with data as data forces us to tackle this question (at least superficially). One of the initial departures from the standard object-oriented toolkit is that when we’re programming with data, we don't have the familiar container of the object to give the things we're modeling their "it-ness." So, the question becomes: what is the canonical thing that flows through our program? What do we, the people writing the code, structure our code around?