From: Chris Hamilton Date: 2005-08-19T06:53:39+09:00 Subject: Re: How would I make object revision storage? Quoting Austin Ziegler : > On 8/18/05, Chris Hamilton 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. > > 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