I'll read about ForwardingProxies because I didn't use it yet.<div><br></div><div>To clarify the context, I'm bulk load transactions from a csv file, so I proccess the file and create each transactions in the user session and I need referencing system entities (operationsTypes, etc) from their codes or names (atCode:) but for do that or I need pass the user session by argument or do a copy to the entity from the shared session. Can you understand my poor english explanation now?</div>
<div><br></div><div>Thanks for your help,</div><div>Facu<br><br><div class="gmail_quote">On Thu, Dec 9, 2010 at 4:35 PM, Chris Muller <span dir="ltr"><<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I'm not sure I fully understand the context, but a third option might<br>
be to use ForwardingProxies. Especially if the shared objects can be<br>
updated by only one session (like a batch updater, for example). Then<br>
every other (user client) session will share the same instances in<br>
memory.<br>
<br>
HTH,<br>
Chris<br>
<div><div></div><div class="h5"><br>
On Wed, Dec 8, 2010 at 1:13 PM, Facundo Vozzi <<a href="mailto:facundov79@gmail.com">facundov79@gmail.com</a>> wrote:<br>
> Hi all,<br>
> I'm refactoring my code and I found that I have two ways to do the same in<br>
> distint parts of my system.<br>
> 1) Entity class >> atCode: aCode<br>
> "Answer the receiver instance with code equal to aCode or evaluate aBlock if<br>
> it doesn't exists."<br>
> ^(self all detect: [:one | one code = aCode]) copy<br>
> or<br>
> 2) Entity class>> atCode: aCode inSession: anUserSession<br>
> "Answer the receiver instance with code equal to aCode or evaluate aBlock if<br>
> it doesn't exists."<br>
><br>
> ^(self allInSession: anUserSession) detect: [:one | one code = aCode]<br>
> The difference is that 1 is using the shared session so I need copy the<br>
> object to be used (referenced by other object) on anUserSession. The uggly<br>
> of 2 is that I have to pass anUserSession as argument.<br>
> Either way works well, is really the same?<br>
> Thanks in advance,<br>
> Facu<br>
> (*) I eliminate aBlock for absent elements for this example<br>
</div></div>> _______________________________________________<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>
><br>
><br>
</blockquote></div><br></div>