<?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: PTOM: Command and Conquer Your UI Coupling Problems</title>
	<atom:link href="http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Fri, 24 May 2013 06:39:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/#comment-65</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Thu, 20 Nov 2008 21:22:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2008/11/19/ptom-command-and-conquer-your-ui-coupling-problems.aspx#comment-65</guid>
		<description>@J.P.

Definitely! The menu structure that this is leading to is begging for a good IoC container and a builder or factory. I didn&#039;t want to go into those details for the meat of this post, though. I think Chad Myers is going to talk about exactly that - IoC and builder / factory - for the PTOM Design Patterns.

*nudge nudge, chad* :)</description>
		<content:encoded><![CDATA[<p>@J.P.</p>
<p>Definitely! The menu structure that this is leading to is begging for a good IoC container and a builder or factory. I didn&#8217;t want to go into those details for the meat of this post, though. I think Chad Myers is going to talk about exactly that &#8211; IoC and builder / factory &#8211; for the PTOM Design Patterns.</p>
<p>*nudge nudge, chad* :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J.P. Hamilton</title>
		<link>http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/#comment-64</link>
		<dc:creator>J.P. Hamilton</dc:creator>
		<pubDate>Thu, 20 Nov 2008 21:10:43 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2008/11/19/ptom-command-and-conquer-your-ui-coupling-problems.aspx#comment-64</guid>
		<description>@Derrik

In the real world would you use something like a MenuBuilder (Builder pattern) to construct your app menu? I am thinking that you could provide the MenuBuilder class references to stuff via DI (like the pricing service you were eluding to).</description>
		<content:encoded><![CDATA[<p>@Derrik</p>
<p>In the real world would you use something like a MenuBuilder (Builder pattern) to construct your app menu? I am thinking that you could provide the MenuBuilder class references to stuff via DI (like the pricing service you were eluding to).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/#comment-63</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Thu, 20 Nov 2008 20:54:45 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2008/11/19/ptom-command-and-conquer-your-ui-coupling-problems.aspx#comment-63</guid>
		<description>ack - forgot to post the specialized menu item:

public class PricedMenuItem
{

	private ICommand _menuCommand;
	private Price _productPrice;

	public Text { get; set; }

	public PricedMenuItem(string menuText, IParameterizedCommand&lt;Price&gt; menuCommand, Price productPrice)
	{
		_menuCommand = menuCommand;
		_productPrice = productPrice;
	}

	public void Click()
	{
		_menuCommand.Execute(_productPrice);
	}

}
</description>
		<content:encoded><![CDATA[<p>ack &#8211; forgot to post the specialized menu item:</p>
<p>public class PricedMenuItem<br />
{</p>
<p>	private ICommand _menuCommand;<br />
	private Price _productPrice;</p>
<p>	public Text { get; set; }</p>
<p>	public PricedMenuItem(string menuText, IParameterizedCommand
<price> menuCommand, Price productPrice)<br />
	{<br />
		_menuCommand = menuCommand;<br />
		_productPrice = productPrice;<br />
	}</p>
<p>	public void Click()<br />
	{<br />
		_menuCommand.Execute(_productPrice);<br />
	}</p>
<p>}
</price>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/#comment-62</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Thu, 20 Nov 2008 20:46:15 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2008/11/19/ptom-command-and-conquer-your-ui-coupling-problems.aspx#comment-62</guid>
		<description>@Ike

DOH! You&#039;ve found the glaring hole in my example. :)

Given the structure that I outlined, I would probably create a specialized MenuItem for products with a price - something like this:

//... somewhere in the application UI
Price coffeePrice = myPriceInfo.GetPriceFor(&quot;Regular Coffee&quot;);
MenuItem regularCoffeeMenuItem = new MenuItem(&quot;Regular Coffee&quot;, new RegularCoffeeCommand(), coffeePrice);

</description>
		<content:encoded><![CDATA[<p>@Ike</p>
<p>DOH! You&#8217;ve found the glaring hole in my example. :)</p>
<p>Given the structure that I outlined, I would probably create a specialized MenuItem for products with a price &#8211; something like this:</p>
<p>//&#8230; somewhere in the application UI<br />
Price coffeePrice = myPriceInfo.GetPriceFor(&#8220;Regular Coffee&#8221;);<br />
MenuItem regularCoffeeMenuItem = new MenuItem(&#8220;Regular Coffee&#8221;, new RegularCoffeeCommand(), coffeePrice);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ike</title>
		<link>http://lostechies.com/derickbailey/2008/11/20/ptom-command-and-conquer-your-ui-coupling-problems/#comment-61</link>
		<dc:creator>Ike</dc:creator>
		<pubDate>Thu, 20 Nov 2008 19:05:59 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2008/11/19/ptom-command-and-conquer-your-ui-coupling-problems.aspx#comment-61</guid>
		<description>Hi,

Can you show an example of the menuitem with a parameterized ICommand.
Right now, I don&#039;t see how you can provide the data to the execute method (cleanly), since you need to have some info on the type. Or do you then also use generic MenuItems

Thanks,
Best regards,
Ike</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Can you show an example of the menuitem with a parameterized ICommand.<br />
Right now, I don&#8217;t see how you can provide the data to the execute method (cleanly), since you need to have some info on the type. Or do you then also use generic MenuItems</p>
<p>Thanks,<br />
Best regards,<br />
Ike</p>
]]></content:encoded>
	</item>
</channel>
</rss>
