<?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: Generic Expression Builder</title>
	<atom:link href="http://elegantcode.com/2009/07/25/generic-expression-builder/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2009/07/25/generic-expression-builder/</link>
	<description></description>
	<lastBuildDate>Wed, 17 Mar 2010 08:54:42 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Fluent Domain Methods &#124; Elegant Code</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-48054</link>
		<dc:creator>Fluent Domain Methods &#124; Elegant Code</dc:creator>
		<pubDate>Sat, 01 Aug 2009 20:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-48054</guid>
		<description>[...] my last post, I talked about a Generic Expression Builder class for easily creating domain entities through expression builders. This generic base class [...]</description>
		<content:encoded><![CDATA[<p>[...] my last post, I talked about a Generic Expression Builder class for easily creating domain entities through expression builders. This generic base class [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jb Evain</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-48030</link>
		<dc:creator>Jb Evain</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-48030</guid>
		<description>That&#039;s indeed a cool usage of the backing field resolver. Glad that it is useful to you!</description>
		<content:encoded><![CDATA[<p>That&#8217;s indeed a cool usage of the backing field resolver. Glad that it is useful to you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47965</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Mon, 27 Jul 2009 18:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47965</guid>
		<description>@Valeriu: Expression builders are especially useful to create and set up an entire aggregate root with all its entities and value objects. No place for behavior. I was just making a point against setters on domain objects.

@Johnny: Agreed on getters. Very hard to do and I&#039;ve learned to live with them. Using static analysis for preventing procedural abuse. The code is part of a small sample app I&#039;ve been working on. Maybe at a given point I&#039;ll put it out there somewhere. 

This is the code for the ReflectionHelper class.
http://snipplr.com/view/17521/reflectionhelper/</description>
		<content:encoded><![CDATA[<p>@Valeriu: Expression builders are especially useful to create and set up an entire aggregate root with all its entities and value objects. No place for behavior. I was just making a point against setters on domain objects.</p>
<p>@Johnny: Agreed on getters. Very hard to do and I&#8217;ve learned to live with them. Using static analysis for preventing procedural abuse. The code is part of a small sample app I&#8217;ve been working on. Maybe at a given point I&#8217;ll put it out there somewhere. </p>
<p>This is the code for the ReflectionHelper class.<br />
<a href="http://snipplr.com/view/17521/reflectionhelper/" rel="nofollow">http://snipplr.com/view/17521/reflectionhelper/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mh</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47961</link>
		<dc:creator>mh</dc:creator>
		<pubDate>Mon, 27 Jul 2009 13:02:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47961</guid>
		<description>Is there a reflectionhelper class that goes with this?</description>
		<content:encoded><![CDATA[<p>Is there a reflectionhelper class that goes with this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny Hall</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47959</link>
		<dc:creator>Johnny Hall</dc:creator>
		<pubDate>Mon, 27 Jul 2009 10:55:14 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47959</guid>
		<description>&lt;a href=&quot;#comment-47956&quot; rel=&quot;nofollow&quot;&gt;@Valeriu Caraulean&lt;/a&gt; 
And I guess that code is a configuration API.</description>
		<content:encoded><![CDATA[<p><a href="#comment-47956" rel="nofollow">@Valeriu Caraulean</a><br />
And I guess that code is a configuration API.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny Hall</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47958</link>
		<dc:creator>Johnny Hall</dc:creator>
		<pubDate>Mon, 27 Jul 2009 10:53:06 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47958</guid>
		<description>Ah, ok, the indentation has disappeared.  But it&#039;s there in spirit.</description>
		<content:encoded><![CDATA[<p>Ah, ok, the indentation has disappeared.  But it&#8217;s there in spirit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny Hall</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47957</link>
		<dc:creator>Johnny Hall</dc:creator>
		<pubDate>Mon, 27 Jul 2009 10:52:07 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47957</guid>
		<description>I have a (configurable, multi-tenant) navigation system, where I have to set up pages with a bunch of properties and relationships.  Without the builder, I have either created (the initial configuration) pages directly from the constructor, or from a factory.  Both ways, the code very quickly ends up looking a mess.

Now I have something like this:

var security = NavigationBuilder
                .ForApplication(Application.Security)
                .ForTenant(Root.Tenant)
                .AddPages(
                    PageBuilder.Named(&quot;main&quot;),
                        PageBuilder.Named(&quot;home&quot;).AsController(),
                            PageBuilder.Named(&quot;dashboard&quot;),
                        PageBuilder.Named(&quot;administration&quot;).ForParent(&quot;main&quot;).AsController()
                )
                .Build();

The indentation inside AddPages is simply there to make it a bit more readable.</description>
		<content:encoded><![CDATA[<p>I have a (configurable, multi-tenant) navigation system, where I have to set up pages with a bunch of properties and relationships.  Without the builder, I have either created (the initial configuration) pages directly from the constructor, or from a factory.  Both ways, the code very quickly ends up looking a mess.</p>
<p>Now I have something like this:</p>
<p>var security = NavigationBuilder<br />
                .ForApplication(Application.Security)<br />
                .ForTenant(Root.Tenant)<br />
                .AddPages(<br />
                    PageBuilder.Named(&#8221;main&#8221;),<br />
                        PageBuilder.Named(&#8221;home&#8221;).AsController(),<br />
                            PageBuilder.Named(&#8221;dashboard&#8221;),<br />
                        PageBuilder.Named(&#8221;administration&#8221;).ForParent(&#8221;main&#8221;).AsController()<br />
                )<br />
                .Build();</p>
<p>The indentation inside AddPages is simply there to make it a bit more readable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valeriu Caraulean</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47956</link>
		<dc:creator>Valeriu Caraulean</dc:creator>
		<pubDate>Mon, 27 Jul 2009 10:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47956</guid>
		<description>&lt;a href=&quot;#comment-47953&quot; rel=&quot;nofollow&quot;&gt;@Johnny Hall&lt;/a&gt; 
Can you give few examples how you&#039;re using it in your domain?

Because i&#039;m strugling to see any usefulness of fluent interfaces outside of places where a kind of configuration API is required. Here, done right, the fluency works very well because of it&#039;s discoverable nature.

But to use it as a replacement for property setters - in my opinion this sounds wrong...</description>
		<content:encoded><![CDATA[<p><a href="#comment-47953" rel="nofollow">@Johnny Hall</a><br />
Can you give few examples how you&#8217;re using it in your domain?</p>
<p>Because i&#8217;m strugling to see any usefulness of fluent interfaces outside of places where a kind of configuration API is required. Here, done right, the fluency works very well because of it&#8217;s discoverable nature.</p>
<p>But to use it as a replacement for property setters &#8211; in my opinion this sounds wrong&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johnny Hall</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47953</link>
		<dc:creator>Johnny Hall</dc:creator>
		<pubDate>Mon, 27 Jul 2009 09:43:53 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47953</guid>
		<description>Hi. Great stuff, I&#039;ve got builders liberally sprinkled around my domain and I think they are invaluable.

Any chance you could bundle the code up into a zip? It has a couple of dependencies (ReflectionHelper, BackingFieldResolver (which itself seems to depend on Mono)) and I think you have an extension method or two in there(Has and Name on Type).

Setters are the work of the devil. There&#039;s a view that Getters aren&#039;t too clever either but that&#039;s a whole nother can o worms.</description>
		<content:encoded><![CDATA[<p>Hi. Great stuff, I&#8217;ve got builders liberally sprinkled around my domain and I think they are invaluable.</p>
<p>Any chance you could bundle the code up into a zip? It has a couple of dependencies (ReflectionHelper, BackingFieldResolver (which itself seems to depend on Mono)) and I think you have an extension method or two in there(Has and Name on Type).</p>
<p>Setters are the work of the devil. There&#8217;s a view that Getters aren&#8217;t too clever either but that&#8217;s a whole nother can o worms.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Earwicker</title>
		<link>http://elegantcode.com/2009/07/25/generic-expression-builder/comment-page-2/#comment-47952</link>
		<dc:creator>Daniel Earwicker</dc:creator>
		<pubDate>Mon, 27 Jul 2009 09:41:37 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2009/07/25/generic-expression-builder/#comment-47952</guid>
		<description>I&#039;d like to second Chris Martin&#039;s comment, but go further:

var doc = new Document
          {
              Author = &quot;Stephen Hawking&quot;,
              Title = &quot;The Universe in a Nutshell&quot;,
              Tags = new[]
                     { 
                         new Tag { Name = &quot;Physics&quot; }
                     }
          };

Where &#039;Tags&#039; is an IEnumerable property.

Or, even better (if these things are required for the constructed object to make sense):

var doc = new Document(&quot;Stephen Hawking&quot;,
                       &quot;The Universe in a Nutshell&quot;,
                       new Tag { Name = &quot;Physics&quot; });

Where the third parameter is &#039;params Tag[] tags&#039; to allow multiple tags.

Fluent methods are a syntax hack used in less expressive languages (Java, C  ) and have no real place in C# 3.0 anymore.</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to second Chris Martin&#8217;s comment, but go further:</p>
<p>var doc = new Document<br />
          {<br />
              Author = &#8220;Stephen Hawking&#8221;,<br />
              Title = &#8220;The Universe in a Nutshell&#8221;,<br />
              Tags = new[]<br />
                     {<br />
                         new Tag { Name = &#8220;Physics&#8221; }<br />
                     }<br />
          };</p>
<p>Where &#8216;Tags&#8217; is an IEnumerable property.</p>
<p>Or, even better (if these things are required for the constructed object to make sense):</p>
<p>var doc = new Document(&#8221;Stephen Hawking&#8221;,<br />
                       &#8220;The Universe in a Nutshell&#8221;,<br />
                       new Tag { Name = &#8220;Physics&#8221; });</p>
<p>Where the third parameter is &#8216;params Tag[] tags&#8217; to allow multiple tags.</p>
<p>Fluent methods are a syntax hack used in less expressive languages (Java, C  ) and have no real place in C# 3.0 anymore.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
