Values and Objects
When designing a system, it's important to distinguish between values that model unchanging quantities or measurements, and objects that have an identity, might change state over time, and model computational processes. In the object-oriented languages that most of us use, the confusion is that both concepts are implemented by the same language construct: classes.
Values are immutable instances that model fixed quantities. They have no individual identity, so two value instances are effectively the same if they have the same state. This means that it makes no sense to compare the identity of two values; doing so can cause some subtle bugs—think of the different ways of comparing two copies of new Integer(999). That's why we're taught to use string1.equals(string2) in Java rather than string1 == string2.
Objects, on the other hand, use mutable state to model their behavior over time. Two objects of the same type have separate identities even if they have exactly the same state now, because their states can diverge if they receive different messages in the future.
In practice, this means that we split our system into two "worlds": values, which are treated functionally, and objects, which implement the stateful behavior of the system. In Part III, you'll see how our coding style varies depending on which world we're working in.
In this book, we will use the term object to refer only to instances with identity, state, and processing—not values. There doesn't appear to be another accepted term that isn't overloaded with other meanings (such as entity and process).