DDD: Your Entity Object Is My Value Object

As a quick primer, an entity object is something that has a identity and can change over time--much like a person--whereas a value object is something that is immutable once constructed and can be interchanged with another value object holding the same value.

I have read, from time to time, the laments of some who would like to see a published list of the all of the various kinds objects--and the classification of each: entity or value object.

Here's the problem: Your entity objects are my value objects. In other words, what you consider to have an innate and distinguishable identity, doesn't particularly concern me. Perhaps a small, yet highly valid example will suffice.

At the grocery store when you, as a consumer, purchase a gallon of milk, do you particularly care which one you purchase? Granted, you may look at the expiration date and pull the one from the back--but what if the expiration dates and milk fat values are the same? Mmm....milk fat....ahhh. In this situation it doesn't matter. You arbitrarily pick one because you don't care.

Let's flip the coin--or should I say cow--over on this one. What about the company that produces the milk? What happens when a bad batch of milk is identified? The producer cares very much which container of milk is which. To them, the container most definitely an entity object--it has identity that may be distinguished from the other containers. Because it's an entity object and has identity, the producer can easily notified the retailers to pull the affected containers of milk.

So which one is your object? Entity or value? Obviously it depends...on your domain.