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'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"><<a href="mailto:fractallyte@csi.com">fractallyte@csi.com</a>></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 -> OrderedCollection (where 'User' is an instance of class 'User', so each item would be unique).<br>
<br>
So, checking up on one's own mailbox would simply entail finding oneself'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't this a no-no, even with refreshing a session?<br>
<br>
Are you suggesting to use MagmaCollections instead of OrderedCollections? Isn't that far more 'expensive', 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 <<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>> wrote:<br>
<br>
> Because for user A and user B, each accessing the one persistent model<br>
> via Session A and Session B, respectively, A would add Message-A to<br>
> B's 'collection' which he accessed from his session. After B<br>
> refreshed his session, his view of the model would reflect his own<br>
> copy of Message-A in his own copy of B's 'collection'.<br>
><br>
> > What is the proper way to implement such a system? I'd be very grateful for any insight!<br>
><br>
> What you said should work just fine. Use MagmaCollections with an<br>
> index on the timestamp so you don't have to worry about<br>
> 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>