Persisting 'applications'

Chris Muller chris at funkyobjects.org
Thu Feb 23 03:22:31 UTC 2006


> sdrBackplane := myMagmaSession root at:
> 'SDRBackplane'
> 
> to get a reference and then
> 
> myMagmaSession root: sdrBackplane
> MagmaSession cleanup
> myMagmaSession root removeKey: 'SDRBackplane'

There's no need to reset the root again, it was
already there since you just got it in the first line.

The cleanUp is just an old sort of 'advanced utility'
method for dereferencing objects from temps in
MethodContexts..  It has nothing to do with removing
anything from a database, just from image memory; I'm
actually not sure whether its needed anymore since I
discovered #fixTemps..

I line 3 is wrapped in a commit, as in:

  myMagmaSession commit: [ myMagmaSession root
removeKey: 'SDRBackplane' ]

that will ensure the "delete" from the database is
saved to disk.  (I quote delete because I prefer the
term "dereference"; there is no delete, per se).

> to remove it (and variations thereof)
> 
> If I do:
> 
> SDRBackplane allInstances
> 
> I can get rid of any instances showing by:
> 
> sdrBackplane := nil
> CommandHistory resetAllHistory
> Smalltalk garbageCollect
> 
> Here's the interesting part. Once there are no
> instances in the image I can
> get one from the db by:
> 
> sdrBackplane := myMagmaSession root at:
> 'SDRBackplane'
> sdrBackplane openInWorld
> 
> and lo and behold the connectors are still
> connected. It seems that if I get
> an instance or even close one (via the halo) and
> openInWorld again the
> connections are broken. It is the act of closing it
> and opening again that
> breaks the connections - NOT MAGMA. This happens
> even when it's not
> persistent.

Ah, ok.  So maybe the connectors should maintain their
state in the World at runtime..  Hard to know.

> So if you tell me how to delete objects reliably
> from Magma I think I might
> be there.

Dereferencing any sub-part of your object-model is a
matter of changing the reference to point to the nil
object (wrapped in commit, of course).

 - Chris



More information about the Squeak-dev mailing list