<?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: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comments on: Don&#8217;t Give Up on the State Pattern Just Yet</title>
	<atom:link href="http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-give-up-on-the-state-pattern-just-yet</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 09:13:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Churriment</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-64375</link>
		<dc:creator>Churriment</dc:creator>
		<pubDate>Tue, 25 Oct 2011 00:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-64375</guid>
		<description>false == CanWithdraw()what?</description>
		<content:encoded><![CDATA[<p>false == CanWithdraw()what?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-2/#comment-55380</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Fri, 02 Apr 2010 05:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55380</guid>
		<description>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</description>
		<content:encoded><![CDATA[<p>@Greg: In my follow-up post I talked about how to mitigate the checking part when using role interfaces. You can remove the polymorphism in the same way using a DynamicObject. As I said, I totally agree with your post and the misuse of any design pattern for that matter. Everything has it advantages and disadvantages and the downside is indeed coupling. But I think there are valid scenarios for using the State pattern as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg Young</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-55177</link>
		<dc:creator>Greg Young</dc:creator>
		<pubDate>Thu, 01 Apr 2010 12:20:50 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-55177</guid>
		<description>I think a bit of what I was posting about was missed.

My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions :) it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism ... I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism ... why? There is a big downside to it in terms of coupling.

Greg</description>
		<content:encoded><![CDATA[<p>I think a bit of what I was posting about was missed.</p>
<p>My issue is not with the state pattern per se though it can get ugly. it is more so with people misusing the state pattern. In my example there would be nothing in common between the 3 versions <img src='http://elegantcode.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  it would be throws laced through much of the implementations. Even if we went to role interfaces we would end up with tons of code checking things. Beyond that there isnt any real use case that would actually be using the polymorphism &#8230; I find it to be quite a trend that people like to make things polymorphic even if they dont actually use the polymorphism &#8230; why? There is a big downside to it in terms of coupling.</p>
<p>Greg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54708</link>
		<dc:creator>Elegant Code &#187; Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Revisited</dc:creator>
		<pubDate>Sat, 27 Mar 2010 00:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54708</guid>
		<description>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</description>
		<content:encoded><![CDATA[<p>[...] my previous post on the subject, I showed how you can remove some of the friction caused by applying the State [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Szymon Kulec</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54653</link>
		<dc:creator>Szymon Kulec</dc:creator>
		<pubDate>Mon, 22 Mar 2010 13:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54653</guid>
		<description>I hope I understand your usage of explicit interfaces in this case, but wouldn&#039;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?

Btw. I do like Greg&#039;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</description>
		<content:encoded><![CDATA[<p>I hope I understand your usage of explicit interfaces in this case, but wouldn&#8217;t it be possible to change all the interfaces to TryDo____ methods? No checks for implementing interfaces, no need to throw exceptions, all to do: returning true after any positive processing or no processing at all. What do you think about this idea?</p>
<p>Btw. I do like Greg&#8217;s proposal, cause the unusual cases are the majority of cases in this state pattern example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Morning Brew - Chris Alcock &#187; The Morning Brew #564</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54645</link>
		<dc:creator>The Morning Brew - Chris Alcock &#187; The Morning Brew #564</dc:creator>
		<pubDate>Mon, 22 Mar 2010 08:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54645</guid>
		<description>[...] Don&#8217;t Give Up on the State Pattern Just Yet - Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</description>
		<content:encoded><![CDATA[<p>[...] Don&#8217;t Give Up on the State Pattern Just Yet &#8211; Jan Van Ryswyck follows on from Greg Young&#8217;s post on the state pattern last week with a look at using interfaces to control what state transition are possible for an object [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Py</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54638</link>
		<dc:creator>Steve Py</dc:creator>
		<pubDate>Sun, 21 Mar 2010 22:37:45 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54638</guid>
		<description>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</description>
		<content:encoded><![CDATA[<p>The issue with approaches like this is that you need to do a lot of type-checking and casting throughout the code for each applicable interface. Interfaces like that are good for simplifying cases where you need to pass an IDepostable etc. to a given object/service though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Birch</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54627</link>
		<dc:creator>Julian Birch</dc:creator>
		<pubDate>Sun, 21 Mar 2010 16:46:11 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54627</guid>
		<description>I&#039;ve got to admit, I&#039;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#039;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#039;t be done.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got to admit, I&#8217;m quite fond of the classic state pattern implementation.  Implementing all of those methods where you can&#8217;t do anything may be a pain, but you end up putting in explicit feedback about why they can&#8217;t be done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Doolittle</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54614</link>
		<dc:creator>Jeff Doolittle</dc:creator>
		<pubDate>Sun, 21 Mar 2010 05:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54614</guid>
		<description>@Jan - yeah, I can see what you mean.  I can think of a few other examples I&#039;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</description>
		<content:encoded><![CDATA[<p>@Jan &#8211; yeah, I can see what you mean.  I can think of a few other examples I&#8217;ve seen where the state pattern implementation contains ISP violations.  I think your approach certainly helps redeem the pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan Van Ryswyck</title>
		<link>http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/comment-page-1/#comment-54609</link>
		<dc:creator>Jan Van Ryswyck</dc:creator>
		<pubDate>Sat, 20 Mar 2010 19:07:46 +0000</pubDate>
		<guid isPermaLink="false">http://elegantcode.com/2010/03/19/dont-give-up-on-the-state-pattern-just-yet/#comment-54609</guid>
		<description>@Rob G The recursion is indeed not the best thing since sliced bread. The original GOF example shows this as well.  

@Jeff Doolittle: I agree, but this seems to be how its mostly used. The original example (TCPState) in the GOF book has the same ISP violation as well.</description>
		<content:encoded><![CDATA[<p>@Rob G The recursion is indeed not the best thing since sliced bread. The original GOF example shows this as well.  </p>
<p>@Jeff Doolittle: I agree, but this seems to be how its mostly used. The original example (TCPState) in the GOF book has the same ISP violation as well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

