I made a Json parser in VisualWorks for our product, and I used an OrderedDictionary, because I wanted to be able to parse json to a JsonObject, then emit a json string back that would be equivalent. With a Dictionary, the order would change, thus making the original and emitted json strings different. Maybe that&#39;s why an OrderedCollection was used.<div>
<br></div><div>Mike</div><div><br clear="all">Mike Hales<br>Engineering Manager<br>KnowledgeScape<br><a href="http://www.kscape.com">www.kscape.com</a><br>
<br><br><div class="gmail_quote">On Mon, Jan 11, 2010 at 5:02 PM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">2010/1/12 Levente Uzonyi &lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;:<br>
</div><div class="im">&gt; On Tue, 12 Jan 2010, Igor Stasenko wrote:<br>
&gt;<br>
&gt;&gt; 2010/1/12 Mike Hales &lt;<a href="mailto:mike.hales@kscape.com">mike.hales@kscape.com</a>&gt;:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Or use better DB - CouchDB ;)<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt; Igor, I noticed your CouchDB library on SqueakSource, but browsing from<br>
&gt;&gt;&gt; the<br>
&gt;&gt;&gt; web interface it looked like a fork of the JSON libraries and I couldn&#39;t<br>
&gt;&gt;&gt; quite tell what was going on. What is the status of this? Is it done and<br>
&gt;&gt;&gt; is<br>
&gt;&gt;&gt; there a tutorial?<br>
&gt;&gt;<br>
&gt;&gt; I forked the JSON library to not interfere with existing one.<br>
&gt;&gt; My main point of displeasure with original, is that JsonObject using a<br>
&gt;&gt; collection<br>
&gt;&gt; of key/value pairs , held in OrderedCollection,<br>
&gt;&gt; while in my implementation a JsonObject is a subclass of Dictionary,<br>
&gt;&gt; which makes accessing properties much faster.<br>
&gt;<br>
&gt; Older versions (up to JSON-ul.15) used a Dictionary. OrderedCollection was a<br>
&gt; bad idea performance-wise.<br>
&gt;<br>
</div>I&#39;m not sure yet. It maybe better to use a dictionary ivar instead of<br>
subclassing a Dictionary.<br>
Because in some places i need to tell the difference between<br>
Dictionary and JsonObject<br>
because i want to be allow to serialize and deserialize arbitrary<br>
smalltalk objects as documents,<br>
including collections and dictionaries , of course.<br>
So, when deserializing, i need to determine somehow, what instance to<br>
create - a Dictionary or<br>
another JsonObject.<br>
<div><div></div><div class="h5"><br>
<br>
&gt;<br>
&gt; Levente<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Also, an original CouchDB package (<a href="http://www.squeaksource.com/CouchDB" target="_blank">http://www.squeaksource.com/CouchDB</a>)<br>
&gt;&gt; using a curl plugin for speaking with database.<br>
&gt;&gt; While my implementation using a sockets, provided by squeak, which allows<br>
&gt;&gt; me<br>
&gt;&gt; to read the data in streaming mode, so i could start parsing a json<br>
&gt;&gt; document, even<br>
&gt;&gt; if its not fully retrieved yet i.e.:<br>
&gt;&gt;<br>
&gt;&gt; stream := (db streaming documentAt: &#39;12345&#39;) readStream.<br>
&gt;&gt; json := Json readFrom: stream.<br>
&gt;&gt;<br>
&gt;&gt;&gt; Mike<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Best regards,<br>
&gt;&gt; Igor Stasenko AKA sig.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></div></blockquote></div><br></div>