<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Stalled and Distracted</title>
	<link>http://webwords.txhawkins.net/2009/06/27/stalled-and-distracted/</link>
	<description>it's words on the web, it's all just words.</description>
	<pubDate>Wed, 08 Sep 2010 23:34:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Bill Hensley</title>
		<link>http://webwords.txhawkins.net/2009/06/27/stalled-and-distracted/#comment-1480</link>
		<author>Bill Hensley</author>
		<pubDate>Mon, 29 Jun 2009 22:53:36 +0000</pubDate>
		<guid>http://webwords.txhawkins.net/2009/06/27/stalled-and-distracted/#comment-1480</guid>
		<description>The pattern you're thinking of is "serialization", as implemented in many class libraries. These libraries handle object references by building a dictionary of objectIDs and object references (or pointers). When you serializing to disk, as you process each object you look it up in the dictionary. If it's not there you assign it a unique ID and add it to the dictionary. Then you right the object's ID with it to disk. Whenever you need to serialize an object reference (pointer) you write its ID to disk instead.

When you deserialize you reverse the process. Each time you read an object into memory you add it to the dictionary. Each time you read an object ID you replace it with the corresponding object reference (pointer).

This works because you the order you serialize an object is by following a depth first traverse of its web of references. If you encounter an object you haven't seen before (its not in the dictionary) you recurse and serialize it before going on to the next member in the current object.

Perhaps you were asking a different question. Did I just explain something you already knew?</description>
		<content:encoded><![CDATA[<p>The pattern you&#8217;re thinking of is &#8220;serialization&#8221;, as implemented in many class libraries. These libraries handle object references by building a dictionary of objectIDs and object references (or pointers). When you serializing to disk, as you process each object you look it up in the dictionary. If it&#8217;s not there you assign it a unique ID and add it to the dictionary. Then you right the object&#8217;s ID with it to disk. Whenever you need to serialize an object reference (pointer) you write its ID to disk instead.</p>
<p>When you deserialize you reverse the process. Each time you read an object into memory you add it to the dictionary. Each time you read an object ID you replace it with the corresponding object reference (pointer).</p>
<p>This works because you the order you serialize an object is by following a depth first traverse of its web of references. If you encounter an object you haven&#8217;t seen before (its not in the dictionary) you recurse and serialize it before going on to the next member in the current object.</p>
<p>Perhaps you were asking a different question. Did I just explain something you already knew?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
