<?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: Maintainable MVC Series: Inversion of Control Container &#8211; StructureMap</title>
	<atom:link href="http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=maintainable-mvc-series-inversion-of-control-container-structuremap</link>
	<description></description>
	<lastBuildDate>Tue, 31 Aug 2010 09:52:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Mike</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-1593</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 19 Aug 2010 20:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-1593</guid>
		<description>Thanks so much for the update!  And the crazy thing is that I put that in, and i&#039;m still getting the error.  Maybe i missed a reference some where.</description>
		<content:encoded><![CDATA[<p>Thanks so much for the update!  And the crazy thing is that I put that in, and i&#8217;m still getting the error.  Maybe i missed a reference some where.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorrit Salverda</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-1012</link>
		<dc:creator>Jorrit Salverda</dc:creator>
		<pubDate>Thu, 08 Jul 2010 05:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-1012</guid>
		<description>Hi Mike, I&#039;ve seen the same problem with non-existing favicon.ico as well (some browsers try to find it regardless if you&#039;ve included it in your html). What IIS does it first looks if a url leads to a physical file. If it doesn&#039;t find a file it tries mvc routing. After the routing other registered handlers can step in. Of course you can change this handler order in IIS but it shouldn&#039;t be neccessary. Your url probably matches with the very greedy route {controller}/{action}/{id}, but why the physical file isn&#039;t served before mvc routing steps in I don&#039;t know. Probably it doesn&#039;t exist where you point to.

For making sure mvc doesn&#039;t try to handle .js files you can add an ignoreroute when registering routes. However the default ignoreroutes in mvc only work for files in the root of your application. For the proper way to ignore certain filetypes all together take a look at Phill Haack&#039;s post about it:

http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx

By the way, a good way to include your javascript files is by using Url.Content, because it resolves the tilde (~) to the proper url, whether your site resides in the root of your domain or a subdirectory:

[csharp]
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%= Url.Content(&quot;~/Scripts/jquery-1.4.1.js&quot;) %&gt;&quot;&gt;&lt;/script&gt;
[/csharp]
</description>
		<content:encoded><![CDATA[<p>Hi Mike, I&#8217;ve seen the same problem with non-existing favicon.ico as well (some browsers try to find it regardless if you&#8217;ve included it in your html). What IIS does it first looks if a url leads to a physical file. If it doesn&#8217;t find a file it tries mvc routing. After the routing other registered handlers can step in. Of course you can change this handler order in IIS but it shouldn&#8217;t be neccessary. Your url probably matches with the very greedy route {controller}/{action}/{id}, but why the physical file isn&#8217;t served before mvc routing steps in I don&#8217;t know. Probably it doesn&#8217;t exist where you point to.</p>
<p>For making sure mvc doesn&#8217;t try to handle .js files you can add an ignoreroute when registering routes. However the default ignoreroutes in mvc only work for files in the root of your application. For the proper way to ignore certain filetypes all together take a look at Phill Haack&#8217;s post about it:</p>
<p><a href="http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx" rel="nofollow">http://haacked.com/archive/2008/07/14/make-routing-ignore-requests-for-a-file-extension.aspx</a></p>
<p>By the way, a good way to include your javascript files is by using Url.Content, because it resolves the tilde (~) to the proper url, whether your site resides in the root of your domain or a subdirectory:</p>
<pre class="brush: csharp;">
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;%= Url.Content(&quot;~/Scripts/jquery-1.4.1.js&quot;) %&gt;&quot;&gt;&lt;/script&gt;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-947</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Tue, 29 Jun 2010 16:58:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-947</guid>
		<description>I&#039;ve implemented how you have it, but I keep getting an error in the GetControllerInstance:

The controller for path &#039;/Conversation/Scripts/jquery-1.4.1.js&#039; was not found or does not implement IController.

Being that I&#039;m new to structuremap and mvc2, do you have any thoughts why it thinks a javascript should be an IController?  Very weird.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve implemented how you have it, but I keep getting an error in the GetControllerInstance:</p>
<p>The controller for path &#8216;/Conversation/Scripts/jquery-1.4.1.js&#8217; was not found or does not implement IController.</p>
<p>Being that I&#8217;m new to structuremap and mvc2, do you have any thoughts why it thinks a javascript should be an IController?  Very weird.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorrit Salverda</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-785</link>
		<dc:creator>Jorrit Salverda</dc:creator>
		<pubDate>Tue, 08 Jun 2010 18:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-785</guid>
		<description>If jou take a close look, just below the code for MVC 1 is the code for MVC 2; that&#039;s the one that uses GetControllerInstance(RequestContext requestContext, Type controllerType).</description>
		<content:encoded><![CDATA[<p>If jou take a close look, just below the code for MVC 1 is the code for MVC 2; that&#8217;s the one that uses GetControllerInstance(RequestContext requestContext, Type controllerType).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-784</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 08 Jun 2010 18:11:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-784</guid>
		<description>Oops! That will teach me to keep reading before posting... (embarrassed). Yes, this is MVC 2. Sorry, never mind.</description>
		<content:encoded><![CDATA[<p>Oops! That will teach me to keep reading before posting&#8230; (embarrassed). Yes, this is MVC 2. Sorry, never mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-783</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Tue, 08 Jun 2010 18:08:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-783</guid>
		<description>What version of StructureMap is this? Using 2.6.1, this doesn&#039;t work. There is no GetControllerInstance(Type controllerType) to override, only GetControllerInstance(RequestContext requestContext, Type controllerType).</description>
		<content:encoded><![CDATA[<p>What version of StructureMap is this? Using 2.6.1, this doesn&#8217;t work. There is no GetControllerInstance(Type controllerType) to override, only GetControllerInstance(RequestContext requestContext, Type controllerType).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jorrit</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-405</link>
		<dc:creator>jorrit</dc:creator>
		<pubDate>Fri, 07 May 2010 06:53:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-405</guid>
		<description>I don&#039;t have any experience with Common Service Locator myself, but Jimmy Bogard is in the middle of writing a series on &lt;a href=&quot;http://www.lostechies.com/blogs/jimmy_bogard/archive/2010/04/26/dependency-injection-in-asp-net-mvc-controllers.aspx&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Dependency Injection with MVC&lt;/a&gt; and has something to say about why Common Service Locator is not very useful.

For myself, I don&#039;t see it as a real problem having this &#039;tight&#039; coupling to StructureMap. As long as the use of the ObjectFactory is restricted to as few locations as possible it isn&#039;t very hard to replace it with another IOC container. 

And experience teaches me that in practice parts of your software are rarely replaced with leaving your interfaces intact. So that&#039;s not something I aim at when I&#039;m talking about maintainability. For me, maintainability is all about Separation of Concerns, Single Reponsibility and last but not least, comprehensibility. The latter is extremely important when developing software in a team. Who remembers exactly why something was written as it was two years after the fact?</description>
		<content:encoded><![CDATA[<p>I don&#8217;t have any experience with Common Service Locator myself, but Jimmy Bogard is in the middle of writing a series on <a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2010/04/26/dependency-injection-in-asp-net-mvc-controllers.aspx" target="_blank" rel="nofollow">Dependency Injection with MVC</a> and has something to say about why Common Service Locator is not very useful.</p>
<p>For myself, I don&#8217;t see it as a real problem having this &#8216;tight&#8217; coupling to StructureMap. As long as the use of the ObjectFactory is restricted to as few locations as possible it isn&#8217;t very hard to replace it with another IOC container. </p>
<p>And experience teaches me that in practice parts of your software are rarely replaced with leaving your interfaces intact. So that&#8217;s not something I aim at when I&#8217;m talking about maintainability. For me, maintainability is all about Separation of Concerns, Single Reponsibility and last but not least, comprehensibility. The latter is extremely important when developing software in a team. Who remembers exactly why something was written as it was two years after the fact?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul T</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-402</link>
		<dc:creator>Paul T</dc:creator>
		<pubDate>Thu, 06 May 2010 23:42:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-402</guid>
		<description>Great, I am in the middle of learning how to &quot;best practice&quot;-build larger web apps with StructureMap and MVC, and your article is timely.

If I may, I am wondering if this article could have a Part II that highlights using the Common Service Locator? As I understand it, this would essentially add a wrapper to StructureMap, making your app even more &quot;maintainable&quot;.</description>
		<content:encoded><![CDATA[<p>Great, I am in the middle of learning how to &#8220;best practice&#8221;-build larger web apps with StructureMap and MVC, and your article is timely.</p>
<p>If I may, I am wondering if this article could have a Part II that highlights using the Common Service Locator? As I understand it, this would essentially add a wrapper to StructureMap, making your app even more &#8220;maintainable&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeroen K</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-112</link>
		<dc:creator>Jeroen K</dc:creator>
		<pubDate>Mon, 29 Mar 2010 12:58:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-112</guid>
		<description>Injection of MVC attributes:
http://www.dominicpettifer.co.uk/Blog/40/dependency-injection-in-asp-net-mvc-2---part-3--custom-dataannotation-validationattributes</description>
		<content:encoded><![CDATA[<p>Injection of MVC attributes:<br />
<a href="http://www.dominicpettifer.co.uk/Blog/40/dependency-injection-in-asp-net-mvc-2---part-3--custom-dataannotation-validationattributes" rel="nofollow">http://www.dominicpettifer.co.uk/Blog/40/dependency-injection-in-asp-net-mvc-2&#8212;part-3&#8211;custom-dataannotation-validationattributes</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rock Ge</title>
		<link>http://blog.jorritsalverda.nl/2010/02/09/maintainable-mvc-series-inversion-of-control-container-structuremap/comment-page-1/#comment-65</link>
		<dc:creator>Rock Ge</dc:creator>
		<pubDate>Tue, 16 Mar 2010 11:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jorritsalverda.nl/?p=57#comment-65</guid>
		<description>Nice article! It took me a while trying to figure out how to inject into MVC attributes. For now I&#039;m just adopting ObjectFactory.GetInstance(). I hope there are better solutions.</description>
		<content:encoded><![CDATA[<p>Nice article! It took me a while trying to figure out how to inject into MVC attributes. For now I&#8217;m just adopting ObjectFactory.GetInstance(). I hope there are better solutions.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
