Persistence design details

Hello, welcome to the forum @jryans!

Those are great questions. You’re right that combined, that language is confusing, so I’ve updated it. It is indeed that the author of the object’s definition determines how it is stored to disk. The reason that Goblins’ persistence mostly “just works” is because define-actor’s default persistence approach is to do the default, which is store the arguments which are passed in at construction time. But the blogpost language wasn’t sufficiently clear about this! define-actor is a convenience, and even it can define different self-portraits with the #:portrait keyword or a different restoration procedure with the #:restore keyword. An object might need less than what was defined at construction time (eg certain arguments can be modified, used once, and/or possibly discarded during construction) but it also may need more if for instance during the constructor process the object constructs new data than what it was given. (Notably this latter pattern is used heavily in Terminal Phase and is yet under-documented… a blogpost to come soon will show off this and other patterns we have discovered too.)

I hope that helps answer your question!

3 Likes