<?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: Method Chaining</title>
	<atom:link href="http://www.factorypattern.com/method-chaining/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.factorypattern.com/method-chaining/</link>
	<description>Just another Object Oriented Weblog</description>
	<lastBuildDate>Fri, 12 Feb 2010 18:48:20 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Veera</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-142</link>
		<dc:creator>Veera</dc:creator>
		<pubDate>Mon, 16 Nov 2009 05:31:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-142</guid>
		<description>Good examples. I&#039;ve always liked the way JQuery does the method chaining. It&#039;s the quickest way to call functions, as there is no need to store the intermediate result objects in temperory variable.</description>
		<content:encoded><![CDATA[<p>Good examples. I&#8217;ve always liked the way JQuery does the method chaining. It&#8217;s the quickest way to call functions, as there is no need to store the intermediate result objects in temperory variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-124</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 13 Nov 2009 21:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-124</guid>
		<description>I agree it&#039;s not something you should use every day due to the overhead and class design unorthodox views. However, it&#039;s a good exercise to know about it. 

I also think it a great way to expose simple api&#039;s. Just imagine you have to use some api where you just put a dot and the available methods are displayed so you can select the desired one. And the Method Chaining will help you to validate the logic and order of methods invoked at compile time.</description>
		<content:encoded><![CDATA[<p>I agree it&#8217;s not something you should use every day due to the overhead and class design unorthodox views. However, it&#8217;s a good exercise to know about it. </p>
<p>I also think it a great way to expose simple api&#8217;s. Just imagine you have to use some api where you just put a dot and the available methods are displayed so you can select the desired one. And the Method Chaining will help you to validate the logic and order of methods invoked at compile time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jose Fernandez</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-122</link>
		<dc:creator>Jose Fernandez</dc:creator>
		<pubDate>Fri, 13 Nov 2009 15:36:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-122</guid>
		<description>While I really like the clarity and efficiency of this method, I&#039;m still having a hard time convincing myself that the loss of clarity in the class design is worth it. The last example has a lot of code overhead to ensure method chaining works and the changing return types would confuse someone not familiar with the class or chaining.

Also imagine how confusing the last class example would be if it were 5-8 methods long (add in some and() and between() methods for example) and how hard it would be to intuitively determine the chain order with multiple elements at the same level. (Try to add in all SQL constructs into the Query class and you&#039;ll see what I mean.)</description>
		<content:encoded><![CDATA[<p>While I really like the clarity and efficiency of this method, I&#8217;m still having a hard time convincing myself that the loss of clarity in the class design is worth it. The last example has a lot of code overhead to ensure method chaining works and the changing return types would confuse someone not familiar with the class or chaining.</p>
<p>Also imagine how confusing the last class example would be if it were 5-8 methods long (add in some and() and between() methods for example) and how hard it would be to intuitively determine the chain order with multiple elements at the same level. (Try to add in all SQL constructs into the Query class and you&#8217;ll see what I mean.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-121</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 13 Nov 2009 13:46:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-121</guid>
		<description>thanks @GHad. You&#039;re right a factory would be better in some real scenario. However, if we need a query object on which we can do selects/inserts/updates we can put all the methods in a single class, or to create several classes for each action. This is just a simple example of method chaining.

I&#039;ve also changed the example and the query class implements now the interfaces.</description>
		<content:encoded><![CDATA[<p>thanks @GHad. You&#8217;re right a factory would be better in some real scenario. However, if we need a query object on which we can do selects/inserts/updates we can put all the methods in a single class, or to create several classes for each action. This is just a simple example of method chaining.</p>
<p>I&#8217;ve also changed the example and the query class implements now the interfaces.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GHad</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-120</link>
		<dc:creator>GHad</dc:creator>
		<pubDate>Fri, 13 Nov 2009 10:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-120</guid>
		<description>In the last example the Query class does not implement the interfaces.

Greetz,
GHad</description>
		<content:encoded><![CDATA[<p>In the last example the Query class does not implement the interfaces.</p>
<p>Greetz,<br />
GHad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-119</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Fri, 13 Nov 2009 10:04:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-119</guid>
		<description>If I understood correctly you can do this

new Query().where(&quot;a=b&quot;).Invoke();  

because Query implements all those interfaces and after new Query() you can pick any method you like and skip some methods (e.g. select)

I think it would be better to provide some satic factory method that returns ISelectedQuery so you will be sure that all methods ar invoked.

Query.select(&quot;*&quot;).from(&quot;table&quot;).where(&quot;a=b&quot;).invoke();</description>
		<content:encoded><![CDATA[<p>If I understood correctly you can do this</p>
<p>new Query().where(&#8220;a=b&#8221;).Invoke();  </p>
<p>because Query implements all those interfaces and after new Query() you can pick any method you like and skip some methods (e.g. select)</p>
<p>I think it would be better to provide some satic factory method that returns ISelectedQuery so you will be sure that all methods ar invoked.</p>
<p>Query.select(&#8220;*&#8221;).from(&#8220;table&#8221;).where(&#8220;a=b&#8221;).invoke();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The0retico</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-118</link>
		<dc:creator>The0retico</dc:creator>
		<pubDate>Fri, 13 Nov 2009 09:19:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-118</guid>
		<description>On DZone you had &quot;advanced&quot; in title, however, you mentioned nothing new compared to http://martinfowler.com/dslwip/MethodChaining.html</description>
		<content:encoded><![CDATA[<p>On DZone you had &#8220;advanced&#8221; in title, however, you mentioned nothing new compared to <a href="http://martinfowler.com/dslwip/MethodChaining.html" rel="nofollow">http://martinfowler.com/dslwip/MethodChaining.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wesslan</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-117</link>
		<dc:creator>Wesslan</dc:creator>
		<pubDate>Fri, 13 Nov 2009 06:45:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-117</guid>
		<description>I think fluent interfaces is a really nice way of doing things.</description>
		<content:encoded><![CDATA[<p>I think fluent interfaces is a really nice way of doing things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ravi Sinha</title>
		<link>http://www.factorypattern.com/method-chaining/comment-page-1/#comment-116</link>
		<dc:creator>Ravi Sinha</dc:creator>
		<pubDate>Fri, 13 Nov 2009 05:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.factorypattern.com/?p=64#comment-116</guid>
		<description>A good post. I liked the SQL query builder example. Might even come handy one day. To make it happen one must have very clear requirements from the beginning, as later changes would prove costly. Some would consider this as a demerit.</description>
		<content:encoded><![CDATA[<p>A good post. I liked the SQL query builder example. Might even come handy one day. To make it happen one must have very clear requirements from the beginning, as later changes would prove costly. Some would consider this as a demerit.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.535 seconds -->
