Squeak SmalltalkJoker Squeak Smalltalk : Persistency : prevnext Refactor Persistent Objects Lazy

>  I wonder what do you do when you need to refactorize some part of 
> the design of your application and you're using GOODS for persistence. 
> When you remove an instVar and specially when you add one.
>  How do you usually take care of your persistent objects (data)? 
> best practices?

The simplest answer, that solves simple versions of this problem, is to 
always use lazy initialization when adding a new instance variable.  
When objects are brought in that were stored before that ivar existed, 
the first time it's accessed it will get filled in with a default 

If classes or ivars are renamed, you can also do a mass migration of 
the data on the server side - see the goodsrv documentation for how to 
do this.

It would be possible, and useful, to do much more sophisticated things 
than this.  Each object in the database knows exactly what the layout 
of its class was at the time it was stored, so that you could in theory 
set things up so that every time an object is loaded, it goes through a 
transformation defined for the specific old/new class layout pair 
that's relevant.  But there aren't any good hooks for this yet.  If 
you're thinking about extending GOODS in this way and want to know 
where to look, drop me a line.