<?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: Aggregated specifications</title>
	<atom:link href="http://mhinze.com/2009/10/08/aggregated-specifications/feed/" rel="self" type="application/rss+xml" />
	<link>http://mhinze.com/2009/10/08/aggregated-specifications/</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: Matt</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-136</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Fri, 28 May 2010 14:37:18 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-136</guid>
		<description><![CDATA[The entity]]></description>
		<content:encoded><![CDATA[<p>The entity</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-135</link>
		<dc:creator><![CDATA[peter]]></dc:creator>
		<pubDate>Fri, 28 May 2010 14:33:23 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-135</guid>
		<description><![CDATA[Hi!
So in this method...
public Product[] Search(IProductSearchQuery query)
    {
        var products = _session.Linq();
        return _filters
            .Where(x =&gt; x.ShouldApply(query))
            .Aggregate(products, (candidates, filter) =&gt;
                filter.Filter(candidates, query)).ToArray();
    }

You are tying yourself to the ENTITY Product or is that an IProduct? If its an implementation of IProduct, why not return IProduct[]
Thanks]]></description>
		<content:encoded><![CDATA[<p>Hi!<br />
So in this method&#8230;<br />
public Product[] Search(IProductSearchQuery query)<br />
    {<br />
        var products = _session.Linq();<br />
        return _filters<br />
            .Where(x =&gt; x.ShouldApply(query))<br />
            .Aggregate(products, (candidates, filter) =&gt;<br />
                filter.Filter(candidates, query)).ToArray();<br />
    }</p>
<p>You are tying yourself to the ENTITY Product or is that an IProduct? If its an implementation of IProduct, why not return IProduct[]<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-134</link>
		<dc:creator><![CDATA[Jeff Doolittle]]></dc:creator>
		<pubDate>Fri, 16 Oct 2009 06:55:17 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-134</guid>
		<description><![CDATA[Matt,

Thanks for this post.  We&#039;ve put Fluent NHibernate + LINQ-To-NHibernate + StructureMap + Aggregated Specifications to use on our current project with great success so far.  The power of aggregated specifications with LINQ is incredible.  The expressiveness without loss of testability has been a huge win for our team.

--Jeff]]></description>
		<content:encoded><![CDATA[<p>Matt,</p>
<p>Thanks for this post.  We&#8217;ve put Fluent NHibernate + LINQ-To-NHibernate + StructureMap + Aggregated Specifications to use on our current project with great success so far.  The power of aggregated specifications with LINQ is incredible.  The expressiveness without loss of testability has been a huge win for our team.</p>
<p>&#8211;Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel Jack</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-133</link>
		<dc:creator><![CDATA[Samuel Jack]]></dc:creator>
		<pubDate>Fri, 09 Oct 2009 08:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-133</guid>
		<description><![CDATA[Matt,
  Of course - should have thought of that! Nice article, by the way.]]></description>
		<content:encoded><![CDATA[<p>Matt,<br />
  Of course &#8211; should have thought of that! Nice article, by the way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luca</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-132</link>
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 16:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-132</guid>
		<description><![CDATA[Very good article!]]></description>
		<content:encoded><![CDATA[<p>Very good article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-131</link>
		<dc:creator><![CDATA[Matt]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 16:00:43 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-131</guid>
		<description><![CDATA[No, you just do a regular state-based test on the return value using AsQueryable and ToArray, etc.  The following code isn&#039;t a good test.  This example is descriptive NOT prescriptive:
&lt;code&gt;&lt;pre&gt;
[Test]
public void Should_filter_products_in_range()
{
	var query = MockRepository.GenerateStub&lt;IProductSearchQuery&gt;();
	query.Price = 6m;
	query.PriceRange = 3;

	var product1 = new Product {Price = 1m};
	var product2 = new Product {Price = 5m};
	var product3 = new Product {Price = 10m};

	var filter = new PriceRangeFilter();

	IQueryable&lt;Product&gt; candidates = new[]{product1, product2, product3}.AsQueryable();

	var products = filter.Filter(candidates, query).ToArray();

	Assert.That(products.Length, Is.EqualTo(1));
	Assert.That(products[0], Is.SameAs(product2));
}&lt;/pre&gt;&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>No, you just do a regular state-based test on the return value using AsQueryable and ToArray, etc.  The following code isn&#8217;t a good test.  This example is descriptive NOT prescriptive:<br />
<code>
<pre>
[Test]
public void Should_filter_products_in_range()
{
	var query = MockRepository.GenerateStub&lt;IProductSearchQuery&gt;();
	query.Price = 6m;
	query.PriceRange = 3;

	var product1 = new Product {Price = 1m};
	var product2 = new Product {Price = 5m};
	var product3 = new Product {Price = 10m};

	var filter = new PriceRangeFilter();

	IQueryable&lt;Product&gt; candidates = new[]{product1, product2, product3}.AsQueryable();

	var products = filter.Filter(candidates, query).ToArray();

	Assert.That(products.Length, Is.EqualTo(1));
	Assert.That(products[0], Is.SameAs(product2));
}</pre>
<p></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Samuel Jack</title>
		<link>http://mhinze.com/2009/10/08/aggregated-specifications/#comment-130</link>
		<dc:creator><![CDATA[Samuel Jack]]></dc:creator>
		<pubDate>Thu, 08 Oct 2009 15:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://mhinze.com/aggregated-specifications/#comment-130</guid>
		<description><![CDATA[Matt,
  When you say you can test drive PriceRangeFilter, I can see how you test ShouldApply, but how do you test the Filter method? Surely that would mean unpicking the IQueryable to find out what criteria had been added to it?]]></description>
		<content:encoded><![CDATA[<p>Matt,<br />
  When you say you can test drive PriceRangeFilter, I can see how you test ShouldApply, but how do you test the Filter method? Surely that would mean unpicking the IQueryable to find out what criteria had been added to it?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

