How would I make object revision storage?

(Chris Hamilton) #1

Hi, what I would like to do is store not just data, but the actual code running
in a system in something like Og. It would be similar to how Zope (I think)
runs objects from its database. I would like to introduce the concept of
versioning classes. ie. There could be a 'stable' version of a class that the
site is using by default while a developer is testing and modifying a new
version of the class on the same system.

I have been thinking about it for a while and wonder if it is feasible or even a
sane idea and how to implement it.

For specific implementation details:

I think the general idea would be that the normal system would contain the
default set of classes loaded. A 'view' would contain version specific
overrides for a list of some classes. When a view is requested, somehow the
version specific classes are loaded and used instead.

Does anybody see a way to implement this using Binding? (does a context include
the classes defined at that time or just 'live' instances)

Another possibility might be altering .new to return the version specific object
when the view tells it to do so.

Any comments or suggestions are appreciated.

Thanks,
Chris Hamilton

(Austin Ziegler) #2

I'm not sure that this will work at this point, as running code can't
be stored -- nor can singleton objects (e.g., Marshal.dump, etc.,
don't work on Proc or singleton objects). That said, you could version
the source code to classes and modify your require to look in the
database first.

-austin

···

On 8/18/05, Chris Hamilton <chris@ambigc.com> wrote:

Hi, what I would like to do is store not just data, but the actual code running
in a system in something like Og. It would be similar to how Zope (I think)
runs objects from its database. I would like to introduce the concept of
versioning classes. ie. There could be a 'stable' version of a class that the
site is using by default while a developer is testing and modifying a new
version of the class on the same system.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

(Chris Hamilton) #3

Quoting Austin Ziegler <halostatue@gmail.com>:

Hi, what I would like to do is store not just data, but the actual code running
in a system in something like Og. It would be similar to how Zope (I think)
runs objects from its database. I would like to introduce the concept of
versioning classes. ie. There could be a 'stable' version of a class that the
site is using by default while a developer is testing and modifying a new
version of the class on the same system.

I'm not sure that this will work at this point, as running code can't
be stored -- nor can singleton objects (e.g., Marshal.dump, etc.,
don't work on Proc or singleton objects). That said, you could version
the source code to classes and modify your require to look in the
database first.

Yes, I think I confused and simplified some issues in my mind here.

I guess I would modify load to load the source code files from db and to search
at that level for the revision of the file. I don't think I would need to
store the instances of things like singletons, Procs, etc. outside of a running
view. At this point to me it looks like a view would be similar to running an
independent process of the server. I figure Og could voluntarily store needed
state for the web apps and assume any other persistence is outside the view(ie.
session based or whatever) and the view could be killed, restarted, etc. like
the server being restarted.

I guess the views could be as minimally different as possible - ie. just
differences in state starting at the call of the modified loads. I mean I
could set all shared state up and then just do each view's loads inside an eval
or a wrapped load of some sort as the last bit right? However, it would be nice
if views could persist until the user session is over or however I tell when the
view will not be needed again(so it only needs to do the loads once). I don't
know if that is possible.

Thanks for your help.
-Chris

···

On 8/18/05, Chris Hamilton <chris@ambigc.com> wrote: