STON: Skip Inst Var
I was migrating some data from Pharo 4 to Pharo 6.1 and fell over the fact that FileSystem has a #workingDirectory instVar in the source, but not in the target. I ended up monkey patching STON until the objects were loaded and then reverting, but is there a way to skip an inst var via the proper STON API? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
On 9 Sep 2017, at 05:44, Sean P. DeNigris <sean@clipperadams.com> wrote:
I was migrating some data from Pharo 4 to Pharo 6.1 and fell over the fact that FileSystem has a #workingDirectory instVar in the source, but not in the target. I ended up monkey patching STON until the objects were loaded and then reverting, but is there a way to skip an inst var via the proper STON API?
STON does not work like NeoJSON where you can define your own mapping. For STON, there is one, system-wide way to serialize/deserialize a specific class. You would have to change the way the offending object get handled.
----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
Sven Van Caekenberghe-2 wrote
You would have to change the way the offending object get handled.
Any suggestions on how to do that? Is there a particularly good place to hook in? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
On 9 Sep 2017, at 16:11, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sven Van Caekenberghe-2 wrote
You would have to change the way the offending object get handled.
Any suggestions on how to do that? Is there a particularly good place to hook in?
Implement FileSystem class>>#stonAllInstVarNames to skip workingDirectory Or implement/customize FileSystem>>#stonOn: and/or #fromSton: But if workingDirectory is an essential part of FileSystem, that would not be a good long term solution. Following migrations like this is never easy/elegant.
Sven Van Caekenberghe-2 wrote
Implement...
Thanks! I added this to the wiki so we don't lose track of it: https://github.com/svenvc/ston/wiki/Cookbook ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
On 9 Sep 2017, at 18:00, Sean P. DeNigris <sean@clipperadams.com> wrote:
Sven Van Caekenberghe-2 wrote
Implement...
Thanks! I added this to the wiki so we don't lose track of it: https://github.com/svenvc/ston/wiki/Cookbook
Cool, thanks.
participants (2)
-
Sean P. DeNigris -
Sven Van Caekenberghe