<?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: First-class relationships in an object-oriented language</title>
	<atom:link href="http://blog.lab49.com/archives/237/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.lab49.com/archives/237</link>
	<description>Technology and industry insights from Lab49.</description>
	<lastBuildDate>Sat, 24 Sep 2011 08:33:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Keith J. Farmer</title>
		<link>http://blog.lab49.com/archives/237/comment-page-1#comment-902</link>
		<dc:creator>Keith J. Farmer</dc:creator>
		<pubDate>Wed, 12 Apr 2006 18:50:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lab49.com/?p=237#comment-902</guid>
		<description>(Caveat:  off the top of my head .. no compiler on this particular machine)

public static class UniversalBagExtension
{
    private static Dictionary bag = new Dictionary();
    public static IList GetItems(this TContainer container)
    {
        if (!bag.HasKey(container))
        {
            bag.Add(container, new Dictionary();
        }

        if (!bag[container].HasKey(typeof(TItem)))
        {
            bag[container].Add(typeof(TItem), new List());
        }

        return bag[container][typeof(TItem)];
    }
}</description>
		<content:encoded><![CDATA[<p>(Caveat:  off the top of my head .. no compiler on this particular machine)</p>
<p>public static class UniversalBagExtension<br />
{<br />
    private static Dictionary bag = new Dictionary();<br />
    public static IList GetItems(this TContainer container)<br />
    {<br />
        if (!bag.HasKey(container))<br />
        {<br />
            bag.Add(container, new Dictionary();<br />
        }</p>
<p>        if (!bag[container].HasKey(typeof(TItem)))<br />
        {<br />
            bag[container].Add(typeof(TItem), new List());<br />
        }</p>
<p>        return bag[container][typeof(TItem)];<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

