On Jan 30, 2008, at 11:17 AM, Tres Seaver wrote:
Ricardo Newbery wrote:
Okay, then assuming you've installed ZEO from Zope software, if your third-party product includes conflict resolution by instantiating a class defined in the Zope product directory, then is it also safe to assume that this product resolution is still available to the ZEO server? For example, if I have the following in MyProduct:
from BTrees import Length
class MyClass(...): _count = None
def incrementCount(self): if self._count is None: self._count = Length.Length() self._count.change(1)
def getCount(self): return self._count()
Then do I have to make MyProduct.MyClass available to ZEO or is it enough that BTrees.Length is available?
That is enough: the Length class derives from Persistent, which means that handle their own conflict resolution: as long as your product doss no conflict resolution of its own, it doesn't need to be imported by the storage server.
Tres.
Great, thanks. Has anyone given thought to maybe providing a more general class with conflict resolution in the core distribution? The Length class works for simple counters and I guess it can also be used for just simple assignments, but what about something more complicated, perhaps with some sort of factory defined at the moment of instantiation? Assuming this is even possible, having such a general purpose conflict resolution class defined in the Zope products directory might make it easier to distribute a third-party product that needs a little conflict resolution. Just a thought. Ric