<?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: An Introduction to Fluent Interfaces &amp; Internal DSLs in C#</title>
	<atom:link href="http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/</link>
	<description>Adventures in Entrepreneurship, Code, Coffee and Photography..</description>
	<lastBuildDate>Sun, 17 Jan 2010 15:42:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: holsee</title>
		<link>http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/comment-page-1/#comment-37</link>
		<dc:creator>holsee</dc:creator>
		<pubDate>Thu, 05 Nov 2009 14:51:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/#comment-37</guid>
		<description>This was a very simple example granted.  I am a fan of object initializers.
I will be going into more detailed assembly of a internal DSL in later posts. 
But in the meantime think about these examples.

A simple internal time DSL in C#:
var time = Twelve.Minutes().Ago(); 
Could be (roughly):
var time = new Time { InPast = true, Perioid = 12, Unit = Unit.Minutes };
This just doesn’t read as well nor is as nice to program against.

Then this example is where we need to build an encapsulated expression. 
If we wish to build a rule that is readable and gets composed as a sentence:

Rule.BecomesActive().When().ValueReaches(100);
Or
Rule.When(rule =&gt; rule.Value &gt;= 100).BecomesActive();

This is fluency in chaining methods, in a instance which is more complex that I find preferable to using an object initializer.  

I don&#039;t like programming against an implementation, in fact I would actively avoid doing so (I would use a factory or some varient) in order to avoid the coupling that &quot;new&quot; keyword entails.  A factory would allow me to string methods on my created object at the point of creation without knowing the underlying implementation.

Hope this helps.  Thanks for the comment</description>
		<content:encoded><![CDATA[<p>This was a very simple example granted.  I am a fan of object initializers.<br />
I will be going into more detailed assembly of a internal DSL in later posts.<br />
But in the meantime think about these examples.</p>
<p>A simple internal time DSL in C#:<br />
var time = Twelve.Minutes().Ago();<br />
Could be (roughly):<br />
var time = new Time { InPast = true, Perioid = 12, Unit = Unit.Minutes };<br />
This just doesn’t read as well nor is as nice to program against.</p>
<p>Then this example is where we need to build an encapsulated expression.<br />
If we wish to build a rule that is readable and gets composed as a sentence:</p>
<p>Rule.BecomesActive().When().ValueReaches(100);<br />
Or<br />
Rule.When(rule => rule.Value >= 100).BecomesActive();</p>
<p>This is fluency in chaining methods, in a instance which is more complex that I find preferable to using an object initializer.  </p>
<p>I don&#8217;t like programming against an implementation, in fact I would actively avoid doing so (I would use a factory or some varient) in order to avoid the coupling that &#8220;new&#8221; keyword entails.  A factory would allow me to string methods on my created object at the point of creation without knowing the underlying implementation.</p>
<p>Hope this helps.  Thanks for the comment</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AgeKay</title>
		<link>http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/comment-page-1/#comment-36</link>
		<dc:creator>AgeKay</dc:creator>
		<pubDate>Wed, 04 Nov 2009 21:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/#comment-36</guid>
		<description>How is this different from using an object initializer where the said methods are properties?

e.g. var coffee = new CoffeeItem {
            Blend = new JavaSumutra(),
            HasCream = true,
            Size = CoffeeSize.Small)
        }</description>
		<content:encoded><![CDATA[<p>How is this different from using an object initializer where the said methods are properties?</p>
<p>e.g. var coffee = new CoffeeItem {<br />
            Blend = new JavaSumutra(),<br />
            HasCream = true,<br />
            Size = CoffeeSize.Small)<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: stefanoric</title>
		<link>http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/comment-page-1/#comment-35</link>
		<dc:creator>stefanoric</dc:creator>
		<pubDate>Tue, 03 Nov 2009 12:36:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/#comment-35</guid>
		<description>This is an interesting topic. I&#039;ll be following your posts.</description>
		<content:encoded><![CDATA[<p>This is an interesting topic. I&#8217;ll be following your posts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reflective Perspective - Chris Alcock &#187; The Morning Brew #468</title>
		<link>http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/comment-page-1/#comment-33</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #468</dc:creator>
		<pubDate>Tue, 03 Nov 2009 08:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/#comment-33</guid>
		<description>[...] An Introduction to Fluent Interfaces &amp; Internal DSLs in C# - Steven Holdsworth shares a simple introduction to the concepts of Fluent Interfaces and Internal DSLs with a simple code example to illustrate, showing that these concepts don&#8217;t have to be big and complicated [...]</description>
		<content:encoded><![CDATA[<p>[...] An Introduction to Fluent Interfaces &amp; Internal DSLs in C# &#8211; Steven Holdsworth shares a simple introduction to the concepts of Fluent Interfaces and Internal DSLs with a simple code example to illustrate, showing that these concepts don&#8217;t have to be big and complicated [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DotNetShoutout</title>
		<link>http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/comment-page-1/#comment-32</link>
		<dc:creator>DotNetShoutout</dc:creator>
		<pubDate>Mon, 02 Nov 2009 16:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.blog.holsee.com/2009/10/fluent-interfaces-internal-domain-specific-languages/#comment-32</guid>
		<description>&lt;strong&gt;An Introduction to Fluent Interfaces &amp; Internal DSLs in C#...&lt;/strong&gt;

Thank you for submitting this cool story - Trackback from DotNetShoutout...</description>
		<content:encoded><![CDATA[<p><strong>An Introduction to Fluent Interfaces &amp; Internal DSLs in C#&#8230;</strong></p>
<p>Thank you for submitting this cool story &#8211; Trackback from DotNetShoutout&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
