STON: Skip Inst Var

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

STON: Skip Inst Var

Sean P. DeNigris
Administrator
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: STON: Skip Inst Var

Sven Van Caekenberghe-2

> On 9 Sep 2017, at 05:44, Sean P. DeNigris <[hidden email]> 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
>


Reply | Threaded
Open this post in threaded view
|

Re: STON: Skip Inst Var

Sean P. DeNigris
Administrator
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: STON: Skip Inst Var

Sven Van Caekenberghe-2

> On 9 Sep 2017, at 16:11, Sean P. DeNigris <[hidden email]> 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.
Reply | Threaded
Open this post in threaded view
|

Re: STON: Skip Inst Var

Sean P. DeNigris
Administrator
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

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: STON: Skip Inst Var

Sven Van Caekenberghe-2

> On 9 Sep 2017, at 18:00, Sean P. DeNigris <[hidden email]> 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.