I am attempting to write a transparent persistence framework and am having a
hard time deciding if something should be a class or it should be a module.
The reason I would like it to be a module is because I am trying to write a
framework where I do not want to interfere with the object model used by
clients of the framework. Ideally they would just include my module and get
my functionality for free thus making persistence even more transparent.
Where I get confused is that this module needs to set some instance variable
state and initialize those variables. I would like it if there was a way for
the state to be set after the the client object has been initialized? If that
is not possible, or possibly not the best way to do it then please let me
Here is some code:
Encapsulates the behavior needed to make objects persistent and is the
all classes wishing to be persisted should mix this in.
# I want these variables to be instance vars.
@is_persistent = false
@timestamp = null
Many thanks in advance for any help offered.