<?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: Specifications versus validators</title>
	<atom:link href="http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/</link>
	<description>Strong opinions, weakly held</description>
	<lastBuildDate>Sat, 25 May 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: CraigCav</title>
		<link>http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/#comment-33</link>
		<dc:creator>CraigCav</dc:creator>
		<pubDate>Wed, 06 Aug 2008 16:49:18 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2007/10/25/specifications-versus-validators.aspx#comment-33</guid>
		<description>Firstly, great post - i&#039;ve been browsing through your feed all day and it&#039;s been really inspiring - keep it up!

I&#039;ve often pondered the use of specifications when validating objects to keep my code DRY - a nice approach i&#039;ve come across recently is demonstrated here: http://www.goeleven.com/blog/entryDetail.aspx?entry=59 The author extends a common implementation of the specification pattern to also include the ability to determine the unsatisfied part of the specification - returning the unsatisfied part as a specification itself. Good stuff! I can imagine it would be relatively painless to extend this to derive user-friendly failure reasons.</description>
		<content:encoded><![CDATA[<p>Firstly, great post &#8211; i&#8217;ve been browsing through your feed all day and it&#8217;s been really inspiring &#8211; keep it up!</p>
<p>I&#8217;ve often pondered the use of specifications when validating objects to keep my code DRY &#8211; a nice approach i&#8217;ve come across recently is demonstrated here: <a href="http://www.goeleven.com/blog/entryDetail.aspx?entry=59" rel="nofollow">http://www.goeleven.com/blog/entryDetail.aspx?entry=59</a> The author extends a common implementation of the specification pattern to also include the ability to determine the unsatisfied part of the specification &#8211; returning the unsatisfied part as a specification itself. Good stuff! I can imagine it would be relatively painless to extend this to derive user-friendly failure reasons.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jimmy Bogard</title>
		<link>http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/#comment-32</link>
		<dc:creator>Jimmy Bogard</dc:creator>
		<pubDate>Thu, 25 Oct 2007 18:07:34 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2007/10/25/specifications-versus-validators.aspx#comment-32</guid>
		<description>I had to go back and read it again, as I like to go from the Nilsson book sometimes.  Here&#039;s the spec purposes from Evans:

1. To validate an object to see if it fulfills some need or is ready for some purpose
2. To select an object from a collection (as in the case of querying for overdue invoices)
3. To specify the creation of a new object to fit some need

I mostly use it for #2.  I could see using specs for #1, but I would still want the feedback part of knowing &quot;why&quot;.  Specs are great for &quot;if&quot;, but I think I&#039;d rather separate validation specs into new &quot;IValidationSpec&quot; interface that also gave me failure reasons.

That is an interesting approach though, I&#039;ll have to keep it in mind.  Just when you thought you knew the Evans book inside and out...
</description>
		<content:encoded><![CDATA[<p>I had to go back and read it again, as I like to go from the Nilsson book sometimes.  Here&#8217;s the spec purposes from Evans:</p>
<p>1. To validate an object to see if it fulfills some need or is ready for some purpose<br />
2. To select an object from a collection (as in the case of querying for overdue invoices)<br />
3. To specify the creation of a new object to fit some need</p>
<p>I mostly use it for #2.  I could see using specs for #1, but I would still want the feedback part of knowing &#8220;why&#8221;.  Specs are great for &#8220;if&#8221;, but I think I&#8217;d rather separate validation specs into new &#8220;IValidationSpec&#8221; interface that also gave me failure reasons.</p>
<p>That is an interesting approach though, I&#8217;ll have to keep it in mind.  Just when you thought you knew the Evans book inside and out&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/#comment-31</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Thu, 25 Oct 2007 17:31:45 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2007/10/25/specifications-versus-validators.aspx#comment-31</guid>
		<description>@Joe -  I a huge fan of the specification pattern when looking for something / filtering, but i think with validation feedback is implied.  A set of specifications will tell me that my order is not valid, but validation will tell me that my order is not valid because the selected delivery date is on a weekend.  Your validation routines could certainly take advantage of the rules that you have coded into Specifications (and i suppose shoud -- why repeat yourself?).

At least that&#039;s my take on it...
BTW = Jeff Perrin did a great post on Specifications a while back: http://devlicio.us/blogs/jeff_perrin/archive/2006/12/13/the-specification-pattern.aspx </description>
		<content:encoded><![CDATA[<p>@Joe &#8211;  I a huge fan of the specification pattern when looking for something / filtering, but i think with validation feedback is implied.  A set of specifications will tell me that my order is not valid, but validation will tell me that my order is not valid because the selected delivery date is on a weekend.  Your validation routines could certainly take advantage of the rules that you have coded into Specifications (and i suppose shoud &#8212; why repeat yourself?).</p>
<p>At least that&#8217;s my take on it&#8230;<br />
BTW = Jeff Perrin did a great post on Specifications a while back: <a href="http://devlicio.us/blogs/jeff_perrin/archive/2006/12/13/the-specification-pattern.aspx" rel="nofollow">http://devlicio.us/blogs/jeff_perrin/archive/2006/12/13/the-specification-pattern.aspx</a> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Ocampo</title>
		<link>http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/#comment-30</link>
		<dc:creator>Joe Ocampo</dc:creator>
		<pubDate>Thu, 25 Oct 2007 16:53:18 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2007/10/25/specifications-versus-validators.aspx#comment-30</guid>
		<description>hmmmm....Maybe my understanding of a Specification differs from yours.  I will have to think about this and ReRead yet again for the umpteenth time DDD[Evans 2003] on the Specification.

From a high level my understanding is that the Specifications impose Ubiquitous predicate constructs in relation to Entity validation.

Suppose during a dialog with the product owner, they inform you that for an order to be valid, that is has to be ordered as of a specific date and not be over a certain amount.

I would then pose the question could we refer to this rule set as the &quot;BasicOrderSpecification&quot; ?  Usually they say sure or we change the nomenclature to be more expressive for them.  Now we have a common &quot;Ubiquitous&quot; term for dealing with the business rules in determining if an order is valid.  

Anytime I bring up the term &quot;BasicOrderSpecification&quot; the team (product owner, developer and QA) knows that I am referring to, must meet a certain ceiling amount and enforce this date rule.

Order order = new Order();
if (BasicOrderSpecification.IsOrderValid(order)...

Aside from my banter, Great post!  That is exactly how I model my Specifications but not how I utilize them.</description>
		<content:encoded><![CDATA[<p>hmmmm&#8230;.Maybe my understanding of a Specification differs from yours.  I will have to think about this and ReRead yet again for the umpteenth time DDD[Evans 2003] on the Specification.</p>
<p>From a high level my understanding is that the Specifications impose Ubiquitous predicate constructs in relation to Entity validation.</p>
<p>Suppose during a dialog with the product owner, they inform you that for an order to be valid, that is has to be ordered as of a specific date and not be over a certain amount.</p>
<p>I would then pose the question could we refer to this rule set as the &#8220;BasicOrderSpecification&#8221; ?  Usually they say sure or we change the nomenclature to be more expressive for them.  Now we have a common &#8220;Ubiquitous&#8221; term for dealing with the business rules in determining if an order is valid.  </p>
<p>Anytime I bring up the term &#8220;BasicOrderSpecification&#8221; the team (product owner, developer and QA) knows that I am referring to, must meet a certain ceiling amount and enforce this date rule.</p>
<p>Order order = new Order();<br />
if (BasicOrderSpecification.IsOrderValid(order)&#8230;</p>
<p>Aside from my banter, Great post!  That is exactly how I model my Specifications but not how I utilize them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cramsay</title>
		<link>http://lostechies.com/jimmybogard/2007/10/25/specifications-versus-validators/#comment-29</link>
		<dc:creator>cramsay</dc:creator>
		<pubDate>Thu, 25 Oct 2007 14:09:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/jimmy_bogard/archive/2007/10/25/specifications-versus-validators.aspx#comment-29</guid>
		<description>Fantastic post.</description>
		<content:encoded><![CDATA[<p>Fantastic post.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
