<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Comment Feed for Channel 9 - Extreme ASP.NET Makeover: Mr. Escher, Your Software is Ready - Host Users Dependency Cycle</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Blogs/howarddierking/Extreme-ASPNET-Makeover-Mr-Escher-Your-Software-is-Ready-Host-Users-Dependency-Cycle/RSS"></atom:link>
	<image>
		<url>http://ecn.channel9.msdn.com/o9/previewImages/100/491007_100x75.jpg</url>
		<title>Channel 9 - Extreme ASP.NET Makeover: Mr. Escher, Your Software is Ready - Host Users Dependency Cycle</title>
		<link></link>
	</image>
	<description>
Extreme ASP.NET Makeover: Mr. Escher, Your Software is Ready –Host Users Dependency Cycle

Going Around in Circles
We successfully refactored away Host’s dependency on Settings.Instance by allowing the IoC container to pass Host an instance of ISettings via its constructor. It seems like a simple matter to continue refactoring away Host’s dependencies on the other Singletons,
 but trouble is brewing just around the corner. The next Singleton we extract is Users.Instance. Following exactly the same procedure as Settings.Instance, we discover a horrible secret - a CircularDependencyException. 
Let’s take a look at the constructors for Host and Users: 
public Host(ISettings settings, IUsers users) {&amp;nbsp;&amp;nbsp;&amp;nbsp; customSpecialTags =         new Dictionary&amp;lt;string, CustomToolbarItem&amp;gt;(5);&amp;nbsp;&amp;nbsp;&amp;nbsp; this.settings = settings;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.users = users;}public Users(IHostV30 host) {&amp;nbsp;&amp;nbsp;&amp;nbsp; this.host = host;}

So Host depends on Users and Users depends on Host. Before the refactoring, this dependency cycle wasn’t obvious. The two components are in fact much more tightly coupled to one another than expected. Let’s take a deeper look at Users to find out where this
 coupling is coming from. 
Other videos from this article

Overview
Dependency
Host Users Dependency Cycle
Circular Dependency Cycle
Refactoring Notification

Read the full article at 
http://msdn.microsoft.com/magazine/ee470637.aspx 
</description>
	<link></link>
	<language>en</language>
	<pubDate>Sat, 18 May 2013 15:27:56 GMT</pubDate>
	<lastBuildDate>Sat, 18 May 2013 15:27:56 GMT</lastBuildDate>
	<generator>Rev9</generator>
</channel>
</rss>