newbie questions

Hilaire Fernandes hilaire2006 at laposte.net
Wed Oct 11 15:26:27 UTC 2006


Hilaire Fernandes a écrit :
> Chris Muller a écrit :
> 
>>> Is commit: only to be used when you want to persist an object?
>>
>>
>>
>> To persist an object, you must use commit.
> 
> 
> 
> Ok, related to this question, here is a situation we are use to: lazy 
> initialization.
> 
> Now here is the following situation:
> 
> Let's MyClass with an attribute diner which is lazilly initialized
> 
> MyClass>>diner
>   diner ifNil:
>     [diner := Diner with: self friends].
>   ^ diner
> 
> An intsance of this class is persisted, next outisde of a transaction, I 
>  am accessing the diner attribute, thus a Diner instance is created.
> If I understand correctly this instance will not be persisted.
> Is it the case?

I can reply myself after a short experimenation, yes it is the case. The 
  Diner instance will not be persisted.

Hilaire



More information about the Magma mailing list