RE: [Zope] Upgrading Zclasses
Sounds like UUIDS or GUIDs would have been an even better identification scheme. -- Alexander Staubo http://www.mop.no/~alex/ "`Ford, you're turning into a penguin. Stop it.'" --Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
-----Original Message----- From: Rob Page [mailto:rob.page@digicool.com] Sent: 22. juli 1999 15:00 To: 'Itamar S.-T.' Cc: 'zope@zope.org' Subject: RE: [Zope] Upgrading Zclasses
What happens if two different people create ZClasses with the same IDs?
For example: Alice creates ZClass Foo. It gets an ID of 2. Bob creates ZClass Bar. It also gets an ID of 2.
Bob imports Foo. Since its ID is already used, I assumes it gets assigned a new one, lets say 3.
Alice changes Foo, and sends Bob the new Foo. When Bob overwrites the old Foo with the new, Zope has to know the Foo's id was changed to 3 from 2. (I admit to adding the second rhyme on purpose).
:^)
If two people create ZClasses with the same ID the scenario you describe will occur. However, the default class id (in the basic tab) is a hash (MD5?) of the hostname and time. The odds of accidentally getting the same class id (unless you change the computed default) are very small.
--Rob
_______________________________________________ Zope maillist - Zope@zope.org http://www.zope.org/mailman/listinfo/zope
(To receive general Zope announcements, see: http://www.zope.org/mailman/listinfo/zope-announce
For developer-specific issues, zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
Alexander Staubo wrote:
Sounds like UUIDS or GUIDs would have been an even better identification scheme.
The algorithm used by ZClasses is very similar to that used in other GUID schemes. The algorithm uses a hash of location (ZClass URL) and time. I think that the probability of collisions is similar between the ZClass alogorithm and other schemes and the ZClass algorithm is alot simpler. Jim -- Jim Fulton mailto:jim@digicool.com Python Powered! Technical Director (888) 344-4332 http://www.python.org Digital Creations http://www.digicool.com http://www.zope.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (2)
-
Alexander Staubo -
Jim Fulton