A few days ago Dylan Beattie wrote a nice post about value objects. He explains the idea in a more palatable way than my attempt:
If it’s not clear how to model a particular element in your model, try asking “which one?” If the question makes sense within your own scenario then you’re probably dealing with entities. If the question “which one” is meaningless in the context of your domain then you’re probably better off modeling the subject of the question as a value object.
I suggest that if you’re maintaining a collection, you implicitly care which one.
Leave a reply