Thanks for the reply... i probably will look into writing my own 
implementation.  Never really thought of it...

Generating GUIDs on server, while i can do that, just makes more 
sense if it's done in the flex app itself.

and yes... these IDs will be used as primary keys in my database... 
at least that's the current design i'm thinking about.

I'm generating an XML document in my flex app, where each 
node/element and its attributes represent a single row and child rows 
in a parent child/foreign key relationship.

When i call a web service, i get my xml document which contains pre-
existing primary keys but when i add elements that have not yet had 
been persisted to the database i don't want to both send up my xml 
data and then turn right around and pull it back down just so my new 
xml elements/nodes have the correct primary keys attached.  That's 
especially important when i save/send up the xml a second and third 
time.

If i can assign my IDs earlier in the process, that solves that 
issue.  I still have to check pre-existence on my server side when i 
actually commit my changes to either run an insert or update sql 
statement.



--- In [email protected], Jim Cheng <[EMAIL PROTECTED]> wrote:
>
> scott_flex wrote:
> > Is there no function or object to generate a GUID, a true 
globally 
> > unique identifier?
> 
> Just write your own--it's dirt simple.  FYI, GUIDs and UUIDs aren't 
> actually guaranteed to be absolutely unique--however, given the 
number 
> of random bits involved, a repeat is statistically highly unlikely 
to 
> happen.
> 
> They're essentially just concatenated random bits,  although in 
some 
> cases a few bits are derived from MAC addresses (per version 1 
UUIDs, 
> which you won't have to access to) or hashes of a URL (version 3 
and 5 
> UUIDs).
> 
> See:
> 
>    http://en.wikipedia.org/wiki/Globally_Unique_Identifier
> 
>    http://www.ietf.org/rfc/rfc4122.txt
> 
> If you need it to play with a server and you're worried about 
repeats 
> enough to expend some developer cycles, a better use of your time 
is to 
> hash the GUIDs that you're given on the server-side and do a quick 
> search for a collision prior to creating a database entry.  This 
tactic 
> also gets you around the possibility of malicious folk passing in 
faked 
> GUIDs that they know may result in a collision.
> 
> Jim Cheng
> effectiveUI
>


Reply via email to