Hi Amir,<div><div>I think that you can try modeling the MailingSystem class wich could be a </div><div>singleton with users and each user would have his own messages. </div><div>Users and messages would be MagmaCollections and then you would&#39;ve three </div>
<div>main classes MailingSystem, User and Message for the beggining.</div><div>Last, you would make persistent your singleton.</div></div><div><br></div><div>My two cents,</div><div>Facu</div><div><br></div><div><br><div>
<br><div class="gmail_quote">On Mon, Jan 3, 2011 at 7:32 AM, Amir Ansari <span dir="ltr">&lt;<a href="mailto:fractallyte@csi.com">fractallyte@csi.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Chris<br>
<br>
I originally thought to create a mailbox for each user in a MagmaPreallocatedDictionary, with the association User -&gt; OrderedCollection (where &#39;User&#39; is an instance of class &#39;User&#39;, so each item would be unique).<br>

<br>
So, checking up on one&#39;s own mailbox would simply entail finding oneself&#39;s User in the Dictionary and reading the associated collection of messages.<br>
<br>
However, if another user were to drop a message into this collection, the same OrderedCollection would have to be accessed by another session.  Isn&#39;t this a no-no, even with refreshing a session?<br>
<br>
Are you suggesting to use MagmaCollections instead of OrderedCollections?  Isn&#39;t that far more &#39;expensive&#39;, especially since each user on the system would be assigned such a collection just to hold their messages?<br>

<font color="#888888"><br>
Amir<br>
</font><div class="im"><br>
<br>
On Sun, 2 Jan 2011 19:30:19 -0600<br>
Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Because for user A and user B, each accessing the one persistent model<br>
&gt; via Session A and Session B, respectively, A would add Message-A to<br>
&gt; B&#39;s &#39;collection&#39; which he accessed from his session.  After B<br>
&gt; refreshed his session, his view of the model would reflect his own<br>
&gt; copy of Message-A in his own copy of B&#39;s &#39;collection&#39;.<br>
&gt;<br>
&gt; &gt; What is the proper way to implement such a system?  I&#39;d be very grateful for any insight!<br>
&gt;<br>
&gt; What you said should work just fine.  Use MagmaCollections with an<br>
&gt; index on the timestamp so you don&#39;t have to worry about<br>
&gt; commit-conflicts.<br>
</div><div><div></div><div class="h5">_______________________________________________<br>
Magma mailing list<br>
<a href="mailto:Magma@lists.squeakfoundation.org">Magma@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/mailman/listinfo/magma" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/magma</a><br>
</div></div></blockquote></div><br></div></div>