<?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: .Net Behavior Driven Development Using NUnit—Next Steps</title>
	<atom:link href="http://lostechies.com/joeocampo/2007/03/10/net-behavior-driven-development-using-nunit-next-steps/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/joeocampo/2007/03/10/net-behavior-driven-development-using-nunit-next-steps/</link>
	<description>Tales from the field...</description>
	<lastBuildDate>Sat, 11 Feb 2012 08:43: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: joeyDotNet</title>
		<link>http://lostechies.com/joeocampo/2007/03/10/net-behavior-driven-development-using-nunit-next-steps/#comment-6</link>
		<dc:creator>joeyDotNet</dc:creator>
		<pubDate>Tue, 24 Apr 2007 10:52:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joe_ocampo/archive/2007/03/09/net-behavior-driven-development-using-nunit-next-steps.aspx#comment-6</guid>
		<description>Right, yeah I&#039;ve used specifications quite a bit for both generic (empty strings, dates, etc.) and for specific business rules.  But up until now I&#039;ve usually put a IsValid and ValidationErrors properties on the actual domain objects that internally use specifications (either as nested class or external) to actually perform the validation.  But I can definitely see the benefits of moving that responsibility to its own validator objects, especially to simplify the tests.

Thanks!</description>
		<content:encoded><![CDATA[<p>Right, yeah I&#8217;ve used specifications quite a bit for both generic (empty strings, dates, etc.) and for specific business rules.  But up until now I&#8217;ve usually put a IsValid and ValidationErrors properties on the actual domain objects that internally use specifications (either as nested class or external) to actually perform the validation.  But I can definitely see the benefits of moving that responsibility to its own validator objects, especially to simplify the tests.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: agilejoe</title>
		<link>http://lostechies.com/joeocampo/2007/03/10/net-behavior-driven-development-using-nunit-next-steps/#comment-5</link>
		<dc:creator>agilejoe</dc:creator>
		<pubDate>Tue, 24 Apr 2007 02:39:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joe_ocampo/archive/2007/03/09/net-behavior-driven-development-using-nunit-next-steps.aspx#comment-5</guid>
		<description>In a word Absolutely!
When I am modeling a domain I pay special attention to treat Entities and Value object as simple data containers.  When the customer asks for a rule to determine the validity of an Entity, I model this concept as a specification or constraint.  The beauty of this concept is that specification or constraint are simply predicates that can be chained together using “&amp;&amp;” or “&#124;&#124;” operators to determine an outcome.  Evans discusses this in the supple design section of the book.  

Remember the most important concept is that the model express what is going on in the domain.  If you hide actions inside of Entities you can never refer to them in the model as the “PersonSpecificaiton”.  The architectural side-effect is that it is much easier to test.  I can code my PersonSepcification and pass in a mock Person type to determine if it is valid.  The Person type is clueless to this validation. 

Don’t forget about Services as well, using the old Order, line item model.  You can pass the Order to a CalcualteOrderTotalService to determine the order total.  Same architectural side-effect as before.

Hope that helps?

Happy coding!
</description>
		<content:encoded><![CDATA[<p>In a word Absolutely!<br />
When I am modeling a domain I pay special attention to treat Entities and Value object as simple data containers.  When the customer asks for a rule to determine the validity of an Entity, I model this concept as a specification or constraint.  The beauty of this concept is that specification or constraint are simply predicates that can be chained together using “&#038;&#038;” or “||” operators to determine an outcome.  Evans discusses this in the supple design section of the book.  </p>
<p>Remember the most important concept is that the model express what is going on in the domain.  If you hide actions inside of Entities you can never refer to them in the model as the “PersonSpecificaiton”.  The architectural side-effect is that it is much easier to test.  I can code my PersonSepcification and pass in a mock Person type to determine if it is valid.  The Person type is clueless to this validation. </p>
<p>Don’t forget about Services as well, using the old Order, line item model.  You can pass the Order to a CalcualteOrderTotalService to determine the order total.  Same architectural side-effect as before.</p>
<p>Hope that helps?</p>
<p>Happy coding!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joeyDotNet</title>
		<link>http://lostechies.com/joeocampo/2007/03/10/net-behavior-driven-development-using-nunit-next-steps/#comment-4</link>
		<dc:creator>joeyDotNet</dc:creator>
		<pubDate>Tue, 24 Apr 2007 02:19:57 +0000</pubDate>
		<guid isPermaLink="false">/blogs/joe_ocampo/archive/2007/03/09/net-behavior-driven-development-using-nunit-next-steps.aspx#comment-4</guid>
		<description>&lt;P&gt;Comment/question on the code sample itself. Up until now I&#039;ve tried to keep as much validation as possible inside my domain objects (somewhat similar to the way Nilsson demonstrates) which in some ways is nice, but I feel it&#039;s starting to violate SRP more than I want. &lt;/P&gt;
&lt;P&gt;I know it&#039;s impossible to generalize something like this and the answer is usually context-sensitive, but have you found that keeping validation outside of the domain objects to be more maintainable in your experience?&lt;/P&gt;</description>
		<content:encoded><![CDATA[<p>Comment/question on the code sample itself. Up until now I&#8217;ve tried to keep as much validation as possible inside my domain objects (somewhat similar to the way Nilsson demonstrates) which in some ways is nice, but I feel it&#8217;s starting to violate SRP more than I want. </p>
<p>I know it&#8217;s impossible to generalize something like this and the answer is usually context-sensitive, but have you found that keeping validation outside of the domain objects to be more maintainable in your experience?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
