idea for unique object id's
Hi all, Is it an idea to make a Folderish class which will generate a unique id when an object is added to it. Perhaps anyone has already done something like this? Greetz, Daniel
People ask for UIDs pretty often. It's a bit tricky to do right. It must be high bandwidth, guaranteed correct, resistant to DOS attacks, and unlikely to make the ZODB grow wildly. It would be good to have a solid Zope-Seal-of-Approval solution in the box. I had a need for this but didn't need anything quite so robust. This simple/stupid solution rolls over in about 12 years and can generate 10 unique ids per second (I think. I should have written it down). In my case the application is behind a firewall with select client access so a more serious solution is not necessary. # I used to generate this ID in an separate python object but I # couldn't make the security work. Very strange. new_id = 'z%08x' % ((DateTime.DateTime().timeTime()-1040000000.0)*10.0) -----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Daniël Hooymans Sent: Thursday, December 19, 2002 7:45 AM To: zope@zope.org Subject: [Zope] idea for unique object id's Hi all, Is it an idea to make a Folderish class which will generate a unique id when an object is added to it. Perhaps anyone has already done something like this? Greetz, Daniel
On Thu, Dec 19, 2002 at 10:25:06AM -0800, Charlie Reiman wrote:
People ask for UIDs pretty often. It's a bit tricky to do right. It must be high bandwidth, guaranteed correct, resistant to DOS attacks, and unlikely to make the ZODB grow wildly. It would be good to have a solid Zope-Seal-of-Approval solution in the box.
FYI: Zope3 will provide a way to get RUIDs (Registry Unique IDs) that will remain constant regardless of renaming the object, moving it to a different folder, etc. This is part of the plan for allowing the creation of reliable relationships between objects. http://www.zope.org//Wikis/DevSite/Proposals/ObjectHub -- Paul Winkler http://www.slinkp.com "Welcome to Muppet Labs, where the future is made - today!" Look! Up in the sky! It's THE TENSILE SEEKER! (courtesy of isometric.spaceninja.com)
participants (3)
-
Charlie Reiman -
Daniël Hooymans -
Paul Winkler