<?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: Property Injection in ASP.NET MVC with Ninject</title>
	<atom:link href="http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/</link>
	<description>web development, tech reviews, tips, tricks, blogging</description>
	<lastBuildDate>Sun, 07 Mar 2010 18:27:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-942</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Sat, 06 Sep 2008 19:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-942</guid>
		<description>Another valid point, but if I don&#039;t refactor the DI stuff then I will end up&lt;br&gt;with a lot of repetition in my unit tests and test fixtures.  I might have&lt;br&gt;to post an example of how I am doing this, to get feedback from the&lt;br&gt;community.  I might be experiencing tunnel vision, since I am the only one&lt;br&gt;writing, reviewing and refactoring the code...</description>
		<content:encoded><![CDATA[<p>Another valid point, but if I don&#39;t refactor the DI stuff then I will end up<br />with a lot of repetition in my unit tests and test fixtures.  I might have<br />to post an example of how I am doing this, to get feedback from the<br />community.  I might be experiencing tunnel vision, since I am the only one<br />writing, reviewing and refactoring the code&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-941</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-941</guid>
		<description>I was doing it via the website. But this time I&#039;m doing it via email.&lt;br&gt;&lt;br&gt;My only concern about doing DI on your tests is that now your tests have&lt;br&gt;dependencies that you can&#039;t see while reading the test.</description>
		<content:encoded><![CDATA[<p>I was doing it via the website. But this time I&#39;m doing it via email.</p>
<p>My only concern about doing DI on your tests is that now your tests have<br />dependencies that you can&#39;t see while reading the test.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-940</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-940</guid>
		<description>I don&#039;t have to use DI in my tests but I do because it is easier...  I have&lt;br&gt;one method that just sets up my DI and all it is really doing is mocking all&lt;br&gt;the interfaces...&lt;br&gt;I don&#039;t know how deep the threads go...  But we can find out :)...  Are you&lt;br&gt;posting your comments on the site or are you just replying to the emails?</description>
		<content:encoded><![CDATA[<p>I don&#39;t have to use DI in my tests but I do because it is easier&#8230;  I have<br />one method that just sets up my DI and all it is really doing is mocking all<br />the interfaces&#8230;<br />I don&#39;t know how deep the threads go&#8230;  But we can find out :)&#8230;  Are you<br />posting your comments on the site or are you just replying to the emails?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-939</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-939</guid>
		<description>Hmmm, I&#039;m not sure why you would _have_ to use DI in your tests rather than creating your controllers and manually injecting your dependencies (which will likely be mocks or stubs).&lt;br&gt;&lt;br&gt;Btw, how deep can these threads go? =)</description>
		<content:encoded><![CDATA[<p>Hmmm, I&#39;m not sure why you would _have_ to use DI in your tests rather than creating your controllers and manually injecting your dependencies (which will likely be mocks or stubs).</p>
<p>Btw, how deep can these threads go? =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-938</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-938</guid>
		<description>I see your point...  I am actually using DI in my tests, which I would have&lt;br&gt;to do anyway to inject constructor arguments.  Actually my DI code in my&lt;br&gt;test project didn&#039;t change when I moved from constructor to property to&lt;br&gt;kernel.get...&lt;br&gt;At points, I feel like kernel.get is a good solution and at other points I&lt;br&gt;feel it&#039;s not.  I can&#039;t explain it :)...</description>
		<content:encoded><![CDATA[<p>I see your point&#8230;  I am actually using DI in my tests, which I would have<br />to do anyway to inject constructor arguments.  Actually my DI code in my<br />test project didn&#39;t change when I moved from constructor to property to<br />kernel.get&#8230;<br />At points, I feel like kernel.get is a good solution and at other points I<br />feel it&#39;s not.  I can&#39;t explain it :)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-937</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Sat, 06 Sep 2008 16:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-937</guid>
		<description>Regarding my opposition to Kernel.Get:&lt;br&gt;&lt;br&gt;From the testing angle I&#039;d rather be able to pass my dependencies in via the constructor (or set via a property) than have to mock an instance of IKernel up.&lt;br&gt;&lt;br&gt;Think about how you&#039;re going to write tests for the controllers that use that property. With the code listed above you would have to either (a) mock the Kernel or (b) actually wire up DI for your tests.</description>
		<content:encoded><![CDATA[<p>Regarding my opposition to Kernel.Get:</p>
<p>From the testing angle I&#39;d rather be able to pass my dependencies in via the constructor (or set via a property) than have to mock an instance of IKernel up.</p>
<p>Think about how you&#39;re going to write tests for the controllers that use that property. With the code listed above you would have to either (a) mock the Kernel or (b) actually wire up DI for your tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-624</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Sat, 06 Sep 2008 12:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-624</guid>
		<description>Another valid point, but if I don&#039;t refactor the DI stuff then I will end up&lt;br&gt;with a lot of repetition in my unit tests and test fixtures.  I might have&lt;br&gt;to post an example of how I am doing this, to get feedback from the&lt;br&gt;community.  I might be experiencing tunnel vision, since I am the only one&lt;br&gt;writing, reviewing and refactoring the code...</description>
		<content:encoded><![CDATA[<p>Another valid point, but if I don&#39;t refactor the DI stuff then I will end up<br />with a lot of repetition in my unit tests and test fixtures.  I might have<br />to post an example of how I am doing this, to get feedback from the<br />community.  I might be experiencing tunnel vision, since I am the only one<br />writing, reviewing and refactoring the code&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-623</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Sat, 06 Sep 2008 11:57:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-623</guid>
		<description>I was doing it via the website. But this time I&#039;m doing it via email.&lt;br&gt;&lt;br&gt;My only concern about doing DI on your tests is that now your tests have&lt;br&gt;dependencies that you can&#039;t see while reading the test.</description>
		<content:encoded><![CDATA[<p>I was doing it via the website. But this time I&#39;m doing it via email.</p>
<p>My only concern about doing DI on your tests is that now your tests have<br />dependencies that you can&#39;t see while reading the test.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-622</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Sat, 06 Sep 2008 11:48:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-622</guid>
		<description>I don&#039;t have to use DI in my tests but I do because it is easier...  I have&lt;br&gt;one method that just sets up my DI and all it is really doing is mocking all&lt;br&gt;the interfaces...&lt;br&gt;I don&#039;t know how deep the threads go...  But we can find out :)...  Are you&lt;br&gt;posting your comments on the site or are you just replying to the emails?</description>
		<content:encoded><![CDATA[<p>I don&#39;t have to use DI in my tests but I do because it is easier&#8230;  I have<br />one method that just sets up my DI and all it is really doing is mocking all<br />the interfaces&#8230;<br />I don&#39;t know how deep the threads go&#8230;  But we can find out :)&#8230;  Are you<br />posting your comments on the site or are you just replying to the emails?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-621</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Sat, 06 Sep 2008 11:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-621</guid>
		<description>Hmmm, I&#039;m not sure why you would _have_ to use DI in your tests rather than creating your controllers and manually injecting your dependencies (which will likely be mocks or stubs).&lt;br&gt;&lt;br&gt;Btw, how deep can these threads go? =)</description>
		<content:encoded><![CDATA[<p>Hmmm, I&#39;m not sure why you would _have_ to use DI in your tests rather than creating your controllers and manually injecting your dependencies (which will likely be mocks or stubs).</p>
<p>Btw, how deep can these threads go? =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-620</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Sat, 06 Sep 2008 11:34:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-620</guid>
		<description>I see your point...  I am actually using DI in my tests, which I would have&lt;br&gt;to do anyway to inject constructor arguments.  Actually my DI code in my&lt;br&gt;test project didn&#039;t change when I moved from constructor to property to&lt;br&gt;kernel.get...&lt;br&gt;At points, I feel like kernel.get is a good solution and at other points I&lt;br&gt;feel it&#039;s not.  I can&#039;t explain it :)...</description>
		<content:encoded><![CDATA[<p>I see your point&#8230;  I am actually using DI in my tests, which I would have<br />to do anyway to inject constructor arguments.  Actually my DI code in my<br />test project didn&#39;t change when I moved from constructor to property to<br />kernel.get&#8230;<br />At points, I feel like kernel.get is a good solution and at other points I<br />feel it&#39;s not.  I can&#39;t explain it :)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-619</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Sat, 06 Sep 2008 09:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-619</guid>
		<description>Regarding my opposition to Kernel.Get:&lt;br&gt;&lt;br&gt;From the testing angle I&#039;d rather be able to pass my dependencies in via the constructor (or set via a property) than have to mock an instance of IKernel up.&lt;br&gt;&lt;br&gt;Think about how you&#039;re going to write tests for the controllers that use that property. With the code listed above you would have to either (a) mock the Kernel or (b) actually wire up DI for your tests.</description>
		<content:encoded><![CDATA[<p>Regarding my opposition to Kernel.Get:</p>
<p>From the testing angle I&#39;d rather be able to pass my dependencies in via the constructor (or set via a property) than have to mock an instance of IKernel up.</p>
<p>Think about how you&#39;re going to write tests for the controllers that use that property. With the code listed above you would have to either (a) mock the Kernel or (b) actually wire up DI for your tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Duncan Smart</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-595</link>
		<dc:creator>Duncan Smart</dc:creator>
		<pubDate>Mon, 01 Sep 2008 17:42:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-595</guid>
		<description>Is there not a Generic version of Kernel.Get? e.g. &lt;br&gt;var Provider = Kernel.Get&lt;MembershipProvider&gt;();</description>
		<content:encoded><![CDATA[<p>Is there not a Generic version of Kernel.Get? e.g. <br />var Provider = Kernel.Get&lt;MembershipProvider&gt;();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eibrahim</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-594</link>
		<dc:creator>eibrahim</dc:creator>
		<pubDate>Mon, 01 Sep 2008 17:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-594</guid>
		<description>The SecuredController solution wouldn&#039;t work for me.  Almost every controller needs to call the property CurrentUser which means every controller will inherit from SecuredController which defeats the point.&lt;br&gt;&lt;br&gt;Why are you opposed to Kernel.Get?  It seems like I can easily achieve the goal I want without having to force every derived controller from calling the base controller consturctor with interfaces...&lt;br&gt;&lt;br&gt;I am trying to get away from doing this&lt;br&gt;&lt;br&gt;class DerviedClass : BaseClass&lt;br&gt;&lt;br&gt;     public DerivedClass(IService1, IService2) : base(IBaseService1, IBaseService2)&lt;br&gt;&lt;br&gt;By using Kernel.Get in the base class then I eliminate the use of base(IBaseService1, IBaseService2) in the derived classes constructor...  I hope that makes sense.</description>
		<content:encoded><![CDATA[<p>The SecuredController solution wouldn&#39;t work for me.  Almost every controller needs to call the property CurrentUser which means every controller will inherit from SecuredController which defeats the point.</p>
<p>Why are you opposed to Kernel.Get?  It seems like I can easily achieve the goal I want without having to force every derived controller from calling the base controller consturctor with interfaces&#8230;</p>
<p>I am trying to get away from doing this</p>
<p>class DerviedClass : BaseClass</p>
<p>     public DerivedClass(IService1, IService2) : base(IBaseService1, IBaseService2)</p>
<p>By using Kernel.Get in the base class then I eliminate the use of base(IBaseService1, IBaseService2) in the derived classes constructor&#8230;  I hope that makes sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TroyGoode</title>
		<link>http://www.emadibrahim.com/2008/08/29/property-injection-in-aspnet-mvc-with-ninject/comment-page-1/#comment-589</link>
		<dc:creator>TroyGoode</dc:creator>
		<pubDate>Fri, 29 Aug 2008 22:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/2008/09/02/property-injection-in-aspnet-mvc-with-ninject/#comment-589</guid>
		<description>For me the Kernel.Get&#039;s should be used as infrequently as possible. You say that you have a BaseController class, but only certain controllers will make use of the MembershipProvider property. Why not create a &quot;SecuredController&quot; that inherits from BaseController and adds the property? This way you&#039;re back to doing the injection at the IoC level and only doing it for the controllers that need it.</description>
		<content:encoded><![CDATA[<p>For me the Kernel.Get&#39;s should be used as infrequently as possible. You say that you have a BaseController class, but only certain controllers will make use of the MembershipProvider property. Why not create a &#8220;SecuredController&#8221; that inherits from BaseController and adds the property? This way you&#39;re back to doing the injection at the IoC level and only doing it for the controllers that need it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
