<?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/"
		>
<channel>
	<title>Comments on: Obvious Testing or: How I Learned to Stop Using the new keyword</title>
	<atom:link href="http://lostechies.com/chrismissal/2009/03/20/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/chrismissal/2009/03/20/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword/</link>
	<description>Thoughts while working and playing as a Software Developer</description>
	<lastBuildDate>Thu, 11 Apr 2013 16:53:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Pat Maddox</title>
		<link>http://lostechies.com/chrismissal/2009/03/20/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword/#comment-50</link>
		<dc:creator>Pat Maddox</dc:creator>
		<pubDate>Sat, 11 Apr 2009 20:44:23 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chrismissal/archive/2009/03/19/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword.aspx#comment-50</guid>
		<description>You could ask the order for the number of items it has, rather than asking it for the collection and then checking the size.  Currently you&#039;re breaking encapsulation by handing out the collection of order items.  One point of OO is that you *should* be able to switch between those two implementations without breaking clients.  So it&#039;s not that the first implementation is wrong, but rather that the design leaves something to be desired.

I wrote a blog post discussing it in more depth, as well as the Aggregate pattern from Domain Driven Design: http://www.patmaddox.com/blog/aggregate_pattern_and_encapsulation</description>
		<content:encoded><![CDATA[<p>You could ask the order for the number of items it has, rather than asking it for the collection and then checking the size.  Currently you&#8217;re breaking encapsulation by handing out the collection of order items.  One point of OO is that you *should* be able to switch between those two implementations without breaking clients.  So it&#8217;s not that the first implementation is wrong, but rather that the design leaves something to be desired.</p>
<p>I wrote a blog post discussing it in more depth, as well as the Aggregate pattern from Domain Driven Design: <a href="http://www.patmaddox.com/blog/aggregate_pattern_and_encapsulation" rel="nofollow">http://www.patmaddox.com/blog/aggregate_pattern_and_encapsulation</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Missal</title>
		<link>http://lostechies.com/chrismissal/2009/03/20/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword/#comment-49</link>
		<dc:creator>Chris Missal</dc:creator>
		<pubDate>Mon, 23 Mar 2009 13:50:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chrismissal/archive/2009/03/19/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword.aspx#comment-49</guid>
		<description>@Morten

1) We could have implemented your first suggestion, I don&#039;t know what we would have gained from a &quot;negative addition&quot; function. I could see this being very useful in some domains, it just didn&#039;t fit in ours.

2) From the Law of Demeter standpoint, do you mean because OrderItems is not a wrapper class? I think it&#039;s okay in that Order isn&#039;t relying on, and reaching into another objects components. Maybe, I&#039;m missing something else?
</description>
		<content:encoded><![CDATA[<p>@Morten</p>
<p>1) We could have implemented your first suggestion, I don&#8217;t know what we would have gained from a &#8220;negative addition&#8221; function. I could see this being very useful in some domains, it just didn&#8217;t fit in ours.</p>
<p>2) From the Law of Demeter standpoint, do you mean because OrderItems is not a wrapper class? I think it&#8217;s okay in that Order isn&#8217;t relying on, and reaching into another objects components. Maybe, I&#8217;m missing something else?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morten Lyhr</title>
		<link>http://lostechies.com/chrismissal/2009/03/20/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword/#comment-48</link>
		<dc:creator>Morten Lyhr</dc:creator>
		<pubDate>Sat, 21 Mar 2009 21:15:56 +0000</pubDate>
		<guid isPermaLink="false">/blogs/chrismissal/archive/2009/03/19/obvious-testing-or-how-i-learned-to-stop-using-the-new-keyword.aspx#comment-48</guid>
		<description>Some toughts...

1). Should a Order follow double bookkeeping, so insted of remove the orderlines add a new one with a negative amount?

2). &quot;order.OrderItems&quot; breaks the law of demiter, I think thats why it fails not because of the &quot;new List&lt;&gt;&quot;. You are exposing state, so when you alter the state, som clients might get surprised ;-)

jus my 2 cents...</description>
		<content:encoded><![CDATA[<p>Some toughts&#8230;</p>
<p>1). Should a Order follow double bookkeeping, so insted of remove the orderlines add a new one with a negative amount?</p>
<p>2). &#8220;order.OrderItems&#8221; breaks the law of demiter, I think thats why it fails not because of the &#8220;new List<>&#8220;. You are exposing state, so when you alter the state, som clients might get surprised ;-)</p>
<p>jus my 2 cents&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
