<?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: Decoupling Workflow And Forms With An Application Controller</title>
	<atom:link href="http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/</link>
	<description>Better Than Yesterday</description>
	<lastBuildDate>Thu, 13 Jun 2013 17:35: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/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-2404</link>
		<dc:creator>Derick Bailey</dc:creator>
		<pubDate>Mon, 30 Apr 2012 11:24:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-2404</guid>
		<description>the sample code that i link to at the bottom of the post shows how to use IContainer. You can see it at https://github.com/derickbailey/appcontroller/blob/master/src/SimpleOrgChart/View/MainForm.cs#L15-19

if I remember right (it&#039;s been 3 years), IContainer is added to the container automatically, by StructureMap.</description>
		<content:encoded><![CDATA[<p>the sample code that i link to at the bottom of the post shows how to use IContainer. You can see it at https://github.com/derickbailey/appcontroller/blob/master/src/SimpleOrgChart/View/MainForm.cs#L15-19</p>
<p>if I remember right (it&#8217;s been 3 years), IContainer is added to the container automatically, by StructureMap.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-2403</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 30 Apr 2012 05:19:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-2403</guid>
		<description>I know its been a while since this was first posted, but thank you very much for this excellent example. It&#039;s almost 6 months ago that I went through your example with a fine tooth comb and it was the first time I finally had my &quot;a-ha&quot; moment and understood the power of dependency injection, and this post was the starting point.

I have gone on to build great things since then, and I have a question:

In your example, in order to allow the presenters to use the user controls created by the designer, you inject into the container the control instance in the constructor.

		public MainForm(IContainer container)
		{
			InitializeComponent();
			container.Inject(ViewEmployeeDetail);
		}
My problem is, what do you do when you have a user control that contains another user control? You cannot put IContainer as a parameter, since user controls can&#039;t handle this.

There is now a BuildUp() function in structuremap, but setter injection seems to solve a different problem ...

My current work around has been to reference structure map statically like so

              public MyControl()
              {
                        InitializeComponent();
                        ObjectFactory.Inject(ChildControl);
               }

however I&#039;d love to know if you have a way to solve this and still be able to use IContainer rather than the static instance.

thanks again
Dave</description>
		<content:encoded><![CDATA[<p>I know its been a while since this was first posted, but thank you very much for this excellent example. It&#8217;s almost 6 months ago that I went through your example with a fine tooth comb and it was the first time I finally had my &#8220;a-ha&#8221; moment and understood the power of dependency injection, and this post was the starting point.</p>
<p>I have gone on to build great things since then, and I have a question:</p>
<p>In your example, in order to allow the presenters to use the user controls created by the designer, you inject into the container the control instance in the constructor.</p>
<p>		public MainForm(IContainer container)<br />
		{<br />
			InitializeComponent();<br />
			container.Inject(ViewEmployeeDetail);<br />
		}<br />
My problem is, what do you do when you have a user control that contains another user control? You cannot put IContainer as a parameter, since user controls can&#8217;t handle this.</p>
<p>There is now a BuildUp() function in structuremap, but setter injection seems to solve a different problem &#8230;</p>
<p>My current work around has been to reference structure map statically like so</p>
<p>              public MyControl()<br />
              {<br />
                        InitializeComponent();<br />
                        ObjectFactory.Inject(ChildControl);<br />
               }</p>
<p>however I&#8217;d love to know if you have a way to solve this and still be able to use IContainer rather than the static instance.</p>
<p>thanks again<br />
Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-244</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Fri, 15 May 2009 20:54:54 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-244</guid>
		<description>@Enrique,

I&#039;ve basically completed the &quot;real world&quot; example application for my upcoming presentation. I decided to use a very simple Org Chart as the sample app. There are a few key pieces of the sample app that I&#039;ll try to outline further, in another blog post: on the main form, I&#039;m using the EventAggregator to get notification of employees being added, and employees being selected from the org chart to display their info. I&#039;m also using an ICommand to kick off the add new employee wizard, and using a workflow service object to run the add new employee wizard.

I hope that this app, being a little more &quot;real world&quot;, will help to shed some more light on the AppController and the other patterns that are in play, for you.

You can get a copy of this app from my Github repository, at:

http://github.com/derickbailey/presentations-and-training/tree/

under the &quot;Decoupling Workflow With App Controller&quot; folder.</description>
		<content:encoded><![CDATA[<p>@Enrique,</p>
<p>I&#8217;ve basically completed the &#8220;real world&#8221; example application for my upcoming presentation. I decided to use a very simple Org Chart as the sample app. There are a few key pieces of the sample app that I&#8217;ll try to outline further, in another blog post: on the main form, I&#8217;m using the EventAggregator to get notification of employees being added, and employees being selected from the org chart to display their info. I&#8217;m also using an ICommand to kick off the add new employee wizard, and using a workflow service object to run the add new employee wizard.</p>
<p>I hope that this app, being a little more &#8220;real world&#8221;, will help to shed some more light on the AppController and the other patterns that are in play, for you.</p>
<p>You can get a copy of this app from my Github repository, at:</p>
<p><a href="http://github.com/derickbailey/presentations-and-training/tree/" rel="nofollow">http://github.com/derickbailey/presentations-and-training/tree/</a></p>
<p>under the &#8220;Decoupling Workflow With App Controller&#8221; folder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrique Ramirez</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-243</link>
		<dc:creator>Enrique Ramirez</dc:creator>
		<pubDate>Thu, 14 May 2009 14:50:38 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-243</guid>
		<description>Oh man, I really wish I could make it to the code camp. I made it a priority to make budget for next year to try to make it to at least one code camp (hopefully somewhere I can get a cheap flight to).

In any case, I really hope to get an &quot;Ah-ha!&quot; moment out of your presentation. Right now I&#039;m using the MVP pattern as described by Craig Shoemaker in his site. The separation of logic is nice, but I still run into a lot of coupling problems when one form has to instantiate and call another and depends on what the user did or entered in that other form. 

Something that I missed the first time around (I think I was speedreading through it just before leaving work), was the idea of using an IoC container to achieve this level of decoupling. I&#039;m yet to use an IoC container, but putting it in context, your code makes a bit more sense now. Time to go read up on IoC containers...</description>
		<content:encoded><![CDATA[<p>Oh man, I really wish I could make it to the code camp. I made it a priority to make budget for next year to try to make it to at least one code camp (hopefully somewhere I can get a cheap flight to).</p>
<p>In any case, I really hope to get an &#8220;Ah-ha!&#8221; moment out of your presentation. Right now I&#8217;m using the MVP pattern as described by Craig Shoemaker in his site. The separation of logic is nice, but I still run into a lot of coupling problems when one form has to instantiate and call another and depends on what the user did or entered in that other form. </p>
<p>Something that I missed the first time around (I think I was speedreading through it just before leaving work), was the idea of using an IoC container to achieve this level of decoupling. I&#8217;m yet to use an IoC container, but putting it in context, your code makes a bit more sense now. Time to go read up on IoC containers&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-242</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Wed, 13 May 2009 21:59:36 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-242</guid>
		<description>@Enrique,

Glad the post helped at least a little! I&#039;m currently writing a much more elaborate, closer-to-real-world example app and presentation based on this blog post, and am hopefully going to be giving a presentation on it at the upcoming Austin Code Camp, on May 30th.

I know you&#039;re not in the Austin area (saw your Twitter location), but I&#039;ll be posting the complete presentation and solution on my blog some time soon after the code camp. Hopefully it will be a little more enlightening. :)</description>
		<content:encoded><![CDATA[<p>@Enrique,</p>
<p>Glad the post helped at least a little! I&#8217;m currently writing a much more elaborate, closer-to-real-world example app and presentation based on this blog post, and am hopefully going to be giving a presentation on it at the upcoming Austin Code Camp, on May 30th.</p>
<p>I know you&#8217;re not in the Austin area (saw your Twitter location), but I&#8217;ll be posting the complete presentation and solution on my blog some time soon after the code camp. Hopefully it will be a little more enlightening. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrique Ramirez</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-241</link>
		<dc:creator>Enrique Ramirez</dc:creator>
		<pubDate>Wed, 13 May 2009 21:11:03 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-241</guid>
		<description>Interesting post. I&#039;ve been looking for something along these lines for a while since coupling problems in WinForms development is my major pain point right now. I didn&#039;t get this 100% since the example is really abstract, but I&#039;ll jyst try to read through it and the code over and over until I get it. 

Again, (like Jeremy said) thanks for writing about Winforms in this age of Web/Silverlight/WPF.</description>
		<content:encoded><![CDATA[<p>Interesting post. I&#8217;ve been looking for something along these lines for a while since coupling problems in WinForms development is my major pain point right now. I didn&#8217;t get this 100% since the example is really abstract, but I&#8217;ll jyst try to read through it and the code over and over until I get it. </p>
<p>Again, (like Jeremy said) thanks for writing about Winforms in this age of Web/Silverlight/WPF.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Wiebe</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-240</link>
		<dc:creator>Jeremy Wiebe</dc:creator>
		<pubDate>Thu, 23 Apr 2009 19:30:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-240</guid>
		<description>@Rei: I think in this case, the ApplicationController is not an MVC controller, but truly is an Application Controller as per Fowler&#039;s definition which Derick mentioned near the beginning.  The presenter&#039;s that are mentioned in this post are often synonymous with controllers from MVC (please correct me if that&#039;s not true..)

@Derick: fantastic post!  Really enjoying your blog since I&#039;ve found it.  Since we&#039;re doing WinForms development it&#039;s nice to see some great blog posts about WinForms in the age of WPF and Silverlight.  :-)</description>
		<content:encoded><![CDATA[<p>@Rei: I think in this case, the ApplicationController is not an MVC controller, but truly is an Application Controller as per Fowler&#8217;s definition which Derick mentioned near the beginning.  The presenter&#8217;s that are mentioned in this post are often synonymous with controllers from MVC (please correct me if that&#8217;s not true..)</p>
<p>@Derick: fantastic post!  Really enjoying your blog since I&#8217;ve found it.  Since we&#8217;re doing WinForms development it&#8217;s nice to see some great blog posts about WinForms in the age of WPF and Silverlight.  :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rei</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-239</link>
		<dc:creator>Rei</dc:creator>
		<pubDate>Sun, 19 Apr 2009 20:33:01 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-239</guid>
		<description>Isn&#039;t this more typically called MVC?</description>
		<content:encoded><![CDATA[<p>Isn&#8217;t this more typically called MVC?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marcos</title>
		<link>http://lostechies.com/derickbailey/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller/#comment-238</link>
		<dc:creator>Marcos</dc:creator>
		<pubDate>Sun, 19 Apr 2009 18:22:51 +0000</pubDate>
		<guid isPermaLink="false">/blogs/derickbailey/archive/2009/04/18/decoupling-workflow-and-forms-with-an-application-controller.aspx#comment-238</guid>
		<description>Thanks a lot, looks really interesting.</description>
		<content:encoded><![CDATA[<p>Thanks a lot, looks really interesting.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
