<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: There is never a collection of Value Objects</title>
	<atom:link href="http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/</link>
	<description>Matt Hinze, learning in public</description>
	<lastBuildDate>Fri, 18 May 2012 15:09:42 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Sosh</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-331</link>
		<dc:creator><![CDATA[Sosh]]></dc:creator>
		<pubDate>Thu, 07 Apr 2011 16:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-331</guid>
		<description><![CDATA[Matt - Completely agree with you here.  I&#039;ve grappled with the same issue myself, and have also come to the conclusion that a collection of value objects is nonsensical.]]></description>
		<content:encoded><![CDATA[<p>Matt &#8211; Completely agree with you here.  I&#8217;ve grappled with the same issue myself, and have also come to the conclusion that a collection of value objects is nonsensical.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: More On Value Objects</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-92</link>
		<dc:creator><![CDATA[More On Value Objects]]></dc:creator>
		<pubDate>Thu, 19 Feb 2009 23:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-92</guid>
		<description><![CDATA[[...] wrote a nice post about value objects.&#160; 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?” [...]]]></description>
		<content:encoded><![CDATA[<p>[...] wrote a nice post about value objects.&nbsp; 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?” [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-91</link>
		<dc:creator><![CDATA[Colin Jack]]></dc:creator>
		<pubDate>Thu, 12 Feb 2009 22:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-91</guid>
		<description><![CDATA[Sure, you could have a HomeAddress property to/instead of.]]></description>
		<content:encoded><![CDATA[<p>Sure, you could have a HomeAddress property to/instead of.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-90</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Sun, 08 Feb 2009 17:04:27 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-90</guid>
		<description><![CDATA[Colin,

If you have a method named ReplaceHomeAddress you aren&#039;t maintaining a collection.  Maybe you are internally, but that&#039;s no different than having a HomeAddress property.]]></description>
		<content:encoded><![CDATA[<p>Colin,</p>
<p>If you have a method named ReplaceHomeAddress you aren&#8217;t maintaining a collection.  Maybe you are internally, but that&#8217;s no different than having a HomeAddress property.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-89</link>
		<dc:creator><![CDATA[Colin Jack]]></dc:creator>
		<pubDate>Sun, 08 Feb 2009 17:01:39 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-89</guid>
		<description><![CDATA[Not sure I agree with you on this.

&quot;If you tried to edit one of the addresses respecting some immutable Value Object oriented thinking, you would clear the collection, find (somehow) the one you intended to edit, replace it along with all the others.&quot;

This doesn&#039;t make sense to me, why am I clearing the collection. Lets say I want to replace the home address, I&#039;d just call ReplaceHomeAddress and it&#039;d replace the Address with an AddressType of Home or it would replace the appropriate item in the dictionary (assuming it was a dictionary). If, when identifying an address, I&#039;m only interested in one piece of its data (Home vs. Work) then thats fine, can&#039;t think why its a problem?



&quot;If you were to take some money out of your wallet, you would subtract from the Value Object, not remove an instance of the Value Object from a collection.&quot;

The wallet is an entity so why not just subtract money (value objects) from it?


&quot;You don&#039;t care if you have five ones or one five, you just care that you have five.&quot;

If it isn&#039;t important to the system then thats fine, it is important in real life if you have a $5 note and you need to hand over $2 of course.


&quot;If I am maintaining a collection of Addresses, I do actually care that each is different - the trick is to find out why.  In my case I care because the Customer has an address history and I wish to maintain that history&quot;

I agree with this, relationship objects are very much under-explained in DDD (http://colinjack.blogspot.com/2008/10/ddd-making-meaningful-relationships_28.html). However as well as temporal aspects you probably also care about different types of addresses, just so happens you&#039;d handle them differently.]]></description>
		<content:encoded><![CDATA[<p>Not sure I agree with you on this.</p>
<p>&#8220;If you tried to edit one of the addresses respecting some immutable Value Object oriented thinking, you would clear the collection, find (somehow) the one you intended to edit, replace it along with all the others.&#8221;</p>
<p>This doesn&#8217;t make sense to me, why am I clearing the collection. Lets say I want to replace the home address, I&#8217;d just call ReplaceHomeAddress and it&#8217;d replace the Address with an AddressType of Home or it would replace the appropriate item in the dictionary (assuming it was a dictionary). If, when identifying an address, I&#8217;m only interested in one piece of its data (Home vs. Work) then thats fine, can&#8217;t think why its a problem?</p>
<p>&#8220;If you were to take some money out of your wallet, you would subtract from the Value Object, not remove an instance of the Value Object from a collection.&#8221;</p>
<p>The wallet is an entity so why not just subtract money (value objects) from it?</p>
<p>&#8220;You don&#8217;t care if you have five ones or one five, you just care that you have five.&#8221;</p>
<p>If it isn&#8217;t important to the system then thats fine, it is important in real life if you have a $5 note and you need to hand over $2 of course.</p>
<p>&#8220;If I am maintaining a collection of Addresses, I do actually care that each is different &#8211; the trick is to find out why.  In my case I care because the Customer has an address history and I wish to maintain that history&#8221;</p>
<p>I agree with this, relationship objects are very much under-explained in DDD (<a href="http://colinjack.blogspot.com/2008/10/ddd-making-meaningful-relationships_28.html" rel="nofollow">http://colinjack.blogspot.com/2008/10/ddd-making-meaningful-relationships_28.html</a>). However as well as temporal aspects you probably also care about different types of addresses, just so happens you&#8217;d handle them differently.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryzam</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-88</link>
		<dc:creator><![CDATA[ryzam]]></dc:creator>
		<pubDate>Tue, 20 Jan 2009 06:45:10 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-88</guid>
		<description><![CDATA[I think the identity that you are referring is a technical identity with the database. I still believe that we can have a collection of value object. If you said that Address is the entity and has their own Id does that Id value is useful within the business or that id only there because of database relation technicality?]]></description>
		<content:encoded><![CDATA[<p>I think the identity that you are referring is a technical identity with the database. I still believe that we can have a collection of value object. If you said that Address is the entity and has their own Id does that Id value is useful within the business or that id only there because of database relation technicality?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-87</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Mon, 12 Jan 2009 18:42:44 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-87</guid>
		<description><![CDATA[Paul, I think that&#039;s a good example until you try to maintain the collection (by editing or deleting one).  I would still model it differently, with Tag being an Aggregate Root itself.]]></description>
		<content:encoded><![CDATA[<p>Paul, I think that&#8217;s a good example until you try to maintain the collection (by editing or deleting one).  I would still model it differently, with Tag being an Aggregate Root itself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paul</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-86</link>
		<dc:creator><![CDATA[paul]]></dc:creator>
		<pubDate>Mon, 12 Jan 2009 18:13:06 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-86</guid>
		<description><![CDATA[&quot;never&quot; I think is an overstatement and while I agree with most of your analysis for the business case you present, I don&#039;t think that you can say that you&#039;ve conclusively proven that no other case can possibly exist.

The example I&#039;d give is tags, or keywords, or the like.  I can choose to refer to them in my &#039;blogpost&#039; entity as a string array, but they&#039;re still not individually important.  I likely would just replace them all upon update rather than specifically editing one in the collection, because I don&#039;t care that much about the keyword itself so much as I care about the fact that a given blogpost is described.]]></description>
		<content:encoded><![CDATA[<p>&#8220;never&#8221; I think is an overstatement and while I agree with most of your analysis for the business case you present, I don&#8217;t think that you can say that you&#8217;ve conclusively proven that no other case can possibly exist.</p>
<p>The example I&#8217;d give is tags, or keywords, or the like.  I can choose to refer to them in my &#8216;blogpost&#8217; entity as a string array, but they&#8217;re still not individually important.  I likely would just replace them all upon update rather than specifically editing one in the collection, because I don&#8217;t care that much about the keyword itself so much as I care about the fact that a given blogpost is described.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-85</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Mon, 12 Jan 2009 14:44:40 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-85</guid>
		<description><![CDATA[Ben, not sure if you are agreeing with me or not.  But I&#039;ll continue to rant anyway.  =)

Scoped identity is still identity.  Sounds like you have a collection of ColorPreference Entities in a User Aggregate.  You still access ColorPreference through the Aggregate (not through the repository), similar to how you would do it &quot;by index&quot;.. &quot;By index&quot; doesn&#039;t really work anyway though.  Consider sort order - it will change from screen to screen.  The counter-argument is, &quot;yeah but I specify the index on the screen, so that even if it&#039;s sorted differently I still know which one is which.&quot;

The counter-counter argument is a) that&#039;s an identity even if you are shoving it into an index and b) whenever you care about a specific instance, &quot;which one is which&quot;, you have an Entity!]]></description>
		<content:encoded><![CDATA[<p>Ben, not sure if you are agreeing with me or not.  But I&#8217;ll continue to rant anyway.  =)</p>
<p>Scoped identity is still identity.  Sounds like you have a collection of ColorPreference Entities in a User Aggregate.  You still access ColorPreference through the Aggregate (not through the repository), similar to how you would do it &#8220;by index&#8221;.. &#8220;By index&#8221; doesn&#8217;t really work anyway though.  Consider sort order &#8211; it will change from screen to screen.  The counter-argument is, &#8220;yeah but I specify the index on the screen, so that even if it&#8217;s sorted differently I still know which one is which.&#8221;</p>
<p>The counter-counter argument is a) that&#8217;s an identity even if you are shoving it into an index and b) whenever you care about a specific instance, &#8220;which one is which&#8221;, you have an Entity!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Scheirman</title>
		<link>http://mhinze.com/2009/01/10/there-is-never-a-collection-of-value-objects/#comment-84</link>
		<dc:creator><![CDATA[Ben Scheirman]]></dc:creator>
		<pubDate>Mon, 12 Jan 2009 13:57:45 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/there-is-never-a-collection-of-value-objects/#comment-84</guid>
		<description><![CDATA[Say I have a profile page where I can save my list of favorite colors.  Each color I add is clearly a value object (RGB 50, 60, 80) but the order in which I add it provides a scoped identity.  If I want to delete one, I delete the one at index X, and it is removed.

You also have to consider whether or not this &quot;value object&quot; is really an entity in disguise.]]></description>
		<content:encoded><![CDATA[<p>Say I have a profile page where I can save my list of favorite colors.  Each color I add is clearly a value object (RGB 50, 60, 80) but the order in which I add it provides a scoped identity.  If I want to delete one, I delete the one at index X, and it is removed.</p>
<p>You also have to consider whether or not this &#8220;value object&#8221; is really an entity in disguise.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

