The Artima Developer Community
Sponsored Link

Java Buzz Forum
Counters as identifiers: a stupid evil plot

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Bill de hÓra

Posts: 1137
Nickname: dehora
Registered: May, 2003

Bill de hÓra is a technical architect with Propylon
Counters as identifiers: a stupid evil plot Posted: Apr 14, 2004 2:42 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Bill de hÓra.
Original Post: Counters as identifiers: a stupid evil plot
Feed Title: Bill de hÓra
Feed URL: http://www.dehora.net/journal/atom.xml
Feed Description: FD85 1117 1888 1681 7689 B5DF E696 885C 20D8 21F8
Latest Java Buzz Posts
Latest Java Buzz Posts by Bill de hÓra
Latest Posts From Bill de hÓra

Advertisement
I came across some code once. It was an API wrapper around some DB calls. Some of the API calls had integer argument. Turns out these are were taking primary keys as arguments, some of which were fixed to constants in the code. My guess this had something to do with the integrity being managed by App code (as repeated selects being joined in software) rather than the DB (as foreign key constraints or SQL based joins). I'm no DB expert then or now, nor do I claim to fully understand the pros and cons of DB v App managed integrity. But I don't imagine that was a very good idea. What if the DB has to be reconstituted and you're using auto-incremented pks (which is what that system happened to do)? Why pass pks around the code when you can use a join? I noticed a while back that Moveable Type uses numbers in its entry URLs. I haven't looked to see if these are bound to DB pks, but they are incrementing. This also strikes me as not a good idea. What if I have rebuild my blog and the numbers are rebound to different entries? Actually that's exactly what happened to me last year when the Berkeley db backing my MT install got totalled. Links people had made to my blog were rebound to different entries. It was off by six or something. Oops. I think Mark Pilgrim or someone wrote something clever once about indirecting MT entries using MT and Apache hacks, but I'm too lazy to look for it and naive enough to think I shouldn't have to. I suppose this is the bit where folks tell me that using GUIDs or URIs as primary keys is a stupid evil plot that any idiot would know about. Not enterprise enough perhaps. Certainly inefficient....

Read: Counters as identifiers: a stupid evil plot

Topic: [Apr 5, 2004 15:59 PDT] 15 Links Previous Topic   Next Topic Topic: [Apr 5, 2004 12:28 PDT] 12 Links

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use