<?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: Service Locator Pattern in C# with Lazy Initialization</title>
	<atom:link href="http://stefanoricciardi.com/2009/10/13/service-locator-pattern-in-c-with-lazy-initialization/feed/" rel="self" type="application/rss+xml" />
	<link>http://stefanoricciardi.com/2009/10/13/service-locator-pattern-in-c-with-lazy-initialization/</link>
	<description>On Software Development and Thereabouts</description>
	<lastBuildDate>Thu, 01 Jul 2010 08:28:24 +0200</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Alex Goldman</title>
		<link>http://stefanoricciardi.com/2009/10/13/service-locator-pattern-in-c-with-lazy-initialization/comment-page-1/#comment-131</link>
		<dc:creator>Alex Goldman</dc:creator>
		<pubDate>Sun, 02 May 2010 07:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://stefanoricciardi.net/?p=423#comment-131</guid>
		<description>Hi,

There is small problem using Dictionary, Some times custom class that you create new instance they inherit several interfaces.
 
I using IList : TheList.OfType(the Interface)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>There is small problem using Dictionary, Some times custom class that you create new instance they inherit several interfaces.</p>
<p>I using IList : TheList.OfType(the Interface)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cameron</title>
		<link>http://stefanoricciardi.com/2009/10/13/service-locator-pattern-in-c-with-lazy-initialization/comment-page-1/#comment-29</link>
		<dc:creator>Cameron</dc:creator>
		<pubDate>Wed, 17 Mar 2010 20:50:22 +0000</pubDate>
		<guid isPermaLink="false">http://stefanoricciardi.net/?p=423#comment-29</guid>
		<description>&quot;It would be interesting to investigate whether mature service locator implementations (Castle Windsor, Spring.NET, StructureMap, etc…) have tackled this kind of problem and how they solved it.&quot;

I think they use weak references (http://msdn.microsoft.com/en-us/library/system.weakreference.aspx)
But I guess that&#039;s the benefit of having a custom service locator class - if you don&#039;t need the logic for instance lifetime management then you can leave it out.</description>
		<content:encoded><![CDATA[<p>&#8220;It would be interesting to investigate whether mature service locator implementations (Castle Windsor, Spring.NET, StructureMap, etc…) have tackled this kind of problem and how they solved it.&#8221;</p>
<p>I think they use weak references (<a href="http://msdn.microsoft.com/en-us/library/system.weakreference.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.weakreference.aspx</a>)<br />
But I guess that&#8217;s the benefit of having a custom service locator class &#8211; if you don&#8217;t need the logic for instance lifetime management then you can leave it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stefano Ricciardi</title>
		<link>http://stefanoricciardi.com/2009/10/13/service-locator-pattern-in-c-with-lazy-initialization/comment-page-1/#comment-28</link>
		<dc:creator>Stefano Ricciardi</dc:creator>
		<pubDate>Thu, 04 Mar 2010 20:29:52 +0000</pubDate>
		<guid isPermaLink="false">http://stefanoricciardi.net/?p=423#comment-28</guid>
		<description>Steven,

you are quite right: providing a method to register services is really the way to go for a complete service locator implementation.

In my specific case I had more limited requirements, having full control of the services that had to be instantiated at run time. So I preferred to &quot;keep it simple&quot;.

About disposing of the services when not needed... well I admit that I hadn&#039;t put much thought into that. I doubt that the service locator itself could/should implement some sort of reference counting.

It would be interesting to investigate whether mature service locator implementations (Castle Windsor, Spring.NET, StructureMap, etc...)  have tackled this kind of problem and how they solved it.</description>
		<content:encoded><![CDATA[<p>Steven,</p>
<p>you are quite right: providing a method to register services is really the way to go for a complete service locator implementation.</p>
<p>In my specific case I had more limited requirements, having full control of the services that had to be instantiated at run time. So I preferred to &#8220;keep it simple&#8221;.</p>
<p>About disposing of the services when not needed&#8230; well I admit that I hadn&#8217;t put much thought into that. I doubt that the service locator itself could/should implement some sort of reference counting.</p>
<p>It would be interesting to investigate whether mature service locator implementations (Castle Windsor, Spring.NET, StructureMap, etc&#8230;)  have tackled this kind of problem and how they solved it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://stefanoricciardi.com/2009/10/13/service-locator-pattern-in-c-with-lazy-initialization/comment-page-1/#comment-27</link>
		<dc:creator>Steven</dc:creator>
		<pubDate>Thu, 04 Mar 2010 15:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://stefanoricciardi.net/?p=423#comment-27</guid>
		<description>Hello, I&#039;ve used something very similar after discovering the Service Locator pattern.

Why have you chosen to register services within the class instead of providing it as a public method?

I like the idea of the lazy loading but was wondering, is there a way for the services to be disposed (or unreferenced) when they&#039;re no longer referenced by anything other than the ServiceLocator?

Thanks :).</description>
		<content:encoded><![CDATA[<p>Hello, I&#8217;ve used something very similar after discovering the Service Locator pattern.</p>
<p>Why have you chosen to register services within the class instead of providing it as a public method?</p>
<p>I like the idea of the lazy loading but was wondering, is there a way for the services to be disposed (or unreferenced) when they&#8217;re no longer referenced by anything other than the ServiceLocator?</p>
<p>Thanks <img src='http://stefanoricciardi.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
</channel>
</rss>
