newbie questions

Hilaire Fernandes hilaire2006 at laposte.net
Wed Oct 11 09:09:13 UTC 2006


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?

Hilaire



More information about the Magma mailing list