title: DDD Entity, Value Objects and Database mapping and updates. An immutable contradiction?
body: <p>I have been working on a little project in DDD. I see everywhere that <strong>Value Objects are immutable</strong>, thus, you <strong>can't modify</strong> it. Only entities.</p>
  
  <p>I am going to use the example everybody uses. Address. Let's say <strong>Address is a VO</strong> of the Customer entity (which is a root aggregate as well). If the user <strong>updates his Address</strong>, which is valid in any shopping cart scenario, then what am i supposed to do? I have to modify that VO address in order for me to persist it into the database. Meaning, this VO must have an identity somehow in order for me to identify it in the database. Unless NHibernate takes care of it using mapping, right. That's not the case with LinqToSql thou. 
  Or I guess i have to create a new Aggregate where Address is an entity instead? Then almost having a copy of Address everywhere i need Address in my aggregates?</p>
  
  <p>However. I still can't wrap the whole Entity/VO concept. Seems to me like everything that has a representation on the DB, even thou you use it as a VO in your Model, it's somehow an entity because in order for you to persist it, you need some sort of KEY to identify it in the database.</p>
  
  <p>At the end of the day, all Value Objects's data come from a database (mostly). So i still can't understand how you must make them immutable in case of updates in that data.</p>
  
  <p>After two months of intense reading, i find the whole DDD a huge contradiction issue. Read all those blogs and you will see what i am talking about. Unfortunately there is ZERO demo applications out there that you can use as a role model or guidance. They all are pretty much influenced by the developer's preferences. Then they end up attacking each other's blog. Overnight-DDD-Guru's blogs are really helping to the confusion of the whole community.</p>
  
  <p>Thank you for stopping by. Looking forward for a constructive discussion.</p>