PureMVC Architects Lounge

Announcements and General Discussion => Architecture => Topic started by: lordnahkim on February 17, 2009, 11:34:07



Title: VO IDs from mysql
Post by: lordnahkim on February 17, 2009, 11:34:07
Hi,

(Cliff, you are a genius)

It seems the recommended creation of VOs, and retrieving those VOs is by using a Stringed ID - is that correct?  The reason I ask is because I'm developing an RIA pulling some arrays from MySQL (via ZendAMF).  I have limited knowledge of the LAMP end of things, so it is hard for me to explain my concern to that team.  My concern is with regard to retrieving IDs as Strings from MySQL - afaik they want to use numbered auto-increment.  Does it break with best practice to use those numbered records when ID'ing my VOs?  Or if anyone knows about lamp stuff, how should I approach fetching records to where I get a String that is more reliable?  They mentioned something about "keys"?

Hope that makes sense.  I appreciate your consultation!


Title: Re: VO IDs from mysql
Post by: puremvc on February 17, 2009, 12:18:26
Auto-increment is easy, but not a super way to generate ids particularly if there will be a massive number of records. UUIDs  are the generally accepted way of creating string IDs that are universally unique. Its a 16 char string Based on time and MAC address usually, but there are various ways of generating them.

MySQL has a method for generating them.

Search wikipedia for UUID, there's a good treatment there.

-=Cliff>


Title: Re: VO IDs from mysql
Post by: Joel Hooks on February 17, 2009, 01:34:24
Flex has UIDUtil for creating them.


Title: Re: VO IDs from mysql
Post by: lordnahkim on February 17, 2009, 10:49:39
Thanks so much for the guidance guys!  I can already imagine the benefits of this approach.