<?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: Is the Specification Pattern obsolete?</title>
	<atom:link href="http://www.minddriven.de/index.php/technology/dot-net/c-sharp/specification-pattern-obsolete/feed" rel="self" type="application/rss+xml" />
	<link>http://www.minddriven.de/index.php/technology/dot-net/c-sharp/specification-pattern-obsolete</link>
	<description>Matthias Jauernig -- .NET technology, architecture and design</description>
	<lastBuildDate>Thu, 02 Feb 2012 06:42:23 +0100</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Chris Melinn</title>
		<link>http://www.minddriven.de/index.php/technology/dot-net/c-sharp/specification-pattern-obsolete/comment-page-1#comment-4304</link>
		<dc:creator>Chris Melinn</dc:creator>
		<pubDate>Sun, 15 Nov 2009 22:41:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.leading-edge-dev.de/?p=466#comment-4304</guid>
		<description>I also agree with your &quot;Bottom Line&quot; conclusions.  The relevance of the pattern, particularly in DDD, is to help in creating a common language to be shared between developers and domain experts.  The fact that LINQ and C# Expressions allow us to implement similar functionality is actually a validation of the pattern and its usefulness.

Thanks for the post!</description>
		<content:encoded><![CDATA[<p>I also agree with your &#8220;Bottom Line&#8221; conclusions.  The relevance of the pattern, particularly in DDD, is to help in creating a common language to be shared between developers and domain experts.  The fact that LINQ and C# Expressions allow us to implement similar functionality is actually a validation of the pattern and its usefulness.</p>
<p>Thanks for the post!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AJ.NET</title>
		<link>http://www.minddriven.de/index.php/technology/dot-net/c-sharp/specification-pattern-obsolete/comment-page-1#comment-4292</link>
		<dc:creator>AJ.NET</dc:creator>
		<pubDate>Sun, 25 Oct 2009 13:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.leading-edge-dev.de/?p=466#comment-4292</guid>
		<description>My personal &quot;default&quot; opinion in this matter is: One can view expressions/expression trees as incarnations of the pattern, thus the pattern is more valid than ever, yet it doesn&#039;t need a dedicated additional implementation (by default). And I don&#039;t like the idea of replacing some core feature for minor gains.

However, there are reasons why you still may want an implementation on top of C# expressions. You named some of them, but I&#039;d like to broaden the topic somewhat: Essentially the specification pattern is a special (and rather limited) incarnation of a DSL. And thus, the usual reasons for coming up with a DSL should apply here:
- raising the level of abstraction. This would gain more efficint development (say RAD style) or open &quot;programability&quot; to new audiences, such as power users. 
- Restricting the feature set (i.e. only allowing certain operations, e.g. only those that make sense in a certain context).    
- configuration/customization over implementation.
- other reasons, like being able to trace and time the execution, offloading workload to other machines, etc.

Personally I have used &quot;specifications&quot; (I don&#039;t like the name either) in two situations where expression trees wouldn&#039;t have helped anyway:
- When I needed a trimmed down &quot;rules engine&quot;
, i.e. some kind of configurable expressions. This is usually the case when these conditions change often or have to be changed by non-developers or on the fly (i.e. without compiling).
- When the application needed end user defined logic, espessially user defined queries, including the ability to edit, store, and execute those queries.



Regarding this post in general: The specification pattern is just one of many patterns that was conceived during the OO heydays. But other approaches, like components, meta programming, functional programming, and the general evolution of the platforms have had an effect and while OO may still be a cornerstone of todays development, it is no longer the sole characteristic. Thus today any pattern from that &quot;early&quot; time may seem questionable at first glance. At second glance it may simply have to be adapted to a changed environment, it may be obsoleted by some competing pattern, or it may be superseded by some broader notion. Bottom line: It&#039;s good to ask these questions, and to question &quot;established knowledge&quot;, as it will at least foster a better understanding, and possibly lead to new, better ideas. Thus good work.</description>
		<content:encoded><![CDATA[<p>My personal &#8220;default&#8221; opinion in this matter is: One can view expressions/expression trees as incarnations of the pattern, thus the pattern is more valid than ever, yet it doesn&#8217;t need a dedicated additional implementation (by default). And I don&#8217;t like the idea of replacing some core feature for minor gains.</p>
<p>However, there are reasons why you still may want an implementation on top of C# expressions. You named some of them, but I&#8217;d like to broaden the topic somewhat: Essentially the specification pattern is a special (and rather limited) incarnation of a DSL. And thus, the usual reasons for coming up with a DSL should apply here:<br />
- raising the level of abstraction. This would gain more efficint development (say RAD style) or open &#8220;programability&#8221; to new audiences, such as power users.<br />
- Restricting the feature set (i.e. only allowing certain operations, e.g. only those that make sense in a certain context).<br />
- configuration/customization over implementation.<br />
- other reasons, like being able to trace and time the execution, offloading workload to other machines, etc.</p>
<p>Personally I have used &#8220;specifications&#8221; (I don&#8217;t like the name either) in two situations where expression trees wouldn&#8217;t have helped anyway:<br />
- When I needed a trimmed down &#8220;rules engine&#8221;<br />
, i.e. some kind of configurable expressions. This is usually the case when these conditions change often or have to be changed by non-developers or on the fly (i.e. without compiling).<br />
- When the application needed end user defined logic, espessially user defined queries, including the ability to edit, store, and execute those queries.</p>
<p>Regarding this post in general: The specification pattern is just one of many patterns that was conceived during the OO heydays. But other approaches, like components, meta programming, functional programming, and the general evolution of the platforms have had an effect and while OO may still be a cornerstone of todays development, it is no longer the sole characteristic. Thus today any pattern from that &#8220;early&#8221; time may seem questionable at first glance. At second glance it may simply have to be adapted to a changed environment, it may be obsoleted by some competing pattern, or it may be superseded by some broader notion. Bottom line: It&#8217;s good to ask these questions, and to question &#8220;established knowledge&#8221;, as it will at least foster a better understanding, and possibly lead to new, better ideas. Thus good work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias Jauernig</title>
		<link>http://www.minddriven.de/index.php/technology/dot-net/c-sharp/specification-pattern-obsolete/comment-page-1#comment-4183</link>
		<dc:creator>Matthias Jauernig</dc:creator>
		<pubDate>Fri, 09 Oct 2009 17:12:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.leading-edge-dev.de/?p=466#comment-4183</guid>
		<description>Perhaps filters, perhaps not. Specifications could be used for more than filtering (validation etc.). Therefore I personally like the name &lt;em&gt;specification&lt;/em&gt;, because it clarifies the intent: specifying some characteristic on the domain model.

There is no mistaking that you &lt;em&gt;could&lt;/em&gt; use Expressions to implement the Specification Pattern on the technical side. But that was not the question and it&#039;s not answering the obsolete concern (btw: In my opinion this doesn&#039;t add any value in nearly all situations in comparison to implementing the Specification Pattern by hand).

To straighten things out again: As you can see with my &quot;focus&quot; sections, the Specification Pattern is not obsolete for me, because it still has an important value. I&#039;ve inserted some bottom line, thanks for the comment!</description>
		<content:encoded><![CDATA[<p>Perhaps filters, perhaps not. Specifications could be used for more than filtering (validation etc.). Therefore I personally like the name <em>specification</em>, because it clarifies the intent: specifying some characteristic on the domain model.</p>
<p>There is no mistaking that you <em>could</em> use Expressions to implement the Specification Pattern on the technical side. But that was not the question and it&#8217;s not answering the obsolete concern (btw: In my opinion this doesn&#8217;t add any value in nearly all situations in comparison to implementing the Specification Pattern by hand).</p>
<p>To straighten things out again: As you can see with my &#8220;focus&#8221; sections, the Specification Pattern is not obsolete for me, because it still has an important value. I&#8217;ve inserted some bottom line, thanks for the comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Goguen</title>
		<link>http://www.minddriven.de/index.php/technology/dot-net/c-sharp/specification-pattern-obsolete/comment-page-1#comment-4182</link>
		<dc:creator>Steve Goguen</dc:creator>
		<pubDate>Fri, 09 Oct 2009 15:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.leading-edge-dev.de/?p=466#comment-4182</guid>
		<description>I don&#039;t think it&#039;s obsolete, all you really have to do it make a slight change in the interface.

Rather than saying:

interface ISpecification {
  bool IsSatisfiedBy(T candidate);
}

Simply change the interface to:

interface IExpSpecification {
  Expression&lt;Func&gt; Predicate { get; }
}

Personally, I&#039;m not to keen on the name specification as I pretty much have to explain that I&#039;m talking about are filters.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think it&#8217;s obsolete, all you really have to do it make a slight change in the interface.</p>
<p>Rather than saying:</p>
<p>interface ISpecification {<br />
  bool IsSatisfiedBy(T candidate);<br />
}</p>
<p>Simply change the interface to:</p>
<p>interface IExpSpecification {<br />
  Expression&lt;Func&gt; Predicate { get; }<br />
}</p>
<p>Personally, I&#8217;m not to keen on the name specification as I pretty much have to explain that I&#8217;m talking about are filters.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

