Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EcoreUtil.generateUUID()
EcoreUtil.generateUUID() [message #1697121] Mon, 01 June 2015 17:51 Go to next message
Al B is currently offline Al BFriend
Messages: 130
Registered: July 2009
Senior Member
Can someone remind me why the EcoreUtil.generateUUID() doesn't generate UUIDs in five group numbers separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). For example:

123e4567-e89b-12d3-a456-426655440000

Instead generates this:

_PNnQffT1EeSYNfDWIQWDJg



[Updated on: Mon, 01 June 2015 17:52]

Report message to a moderator

Re: EcoreUtil.generateUUID() [message #1697156 is a reply to message #1697121] Tue, 02 June 2015 04:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Al,

Because it was always that way. :-P

It's hard to believe EMF is 15 years old and existed as a MOF
implementation at IBM even before that. I don't recall exactly why we
took this form, but two considerations are clear:

One uses 36 characters the other 23, so so the choice made takes 2/3
as much memory to represent. It's still sad that 8 bytes of information
takes uses almost 90 bytes to represent, but XMI allows arbitrary IDs...
One is not an xmi:ID and the other is. It seems good that an ID be
an xsd:ID.

In any case, the irony of a universally unique identifier is that to the
human eye, they're no better than a blurry eye chart.


On 01/06/2015 7:51 PM, Al B wrote:
> Can someone remind me why the EcoreUtil.generateUUID() doesn't
> generate UUIDs in five group numbers separated by hyphens, in the form
> 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters
> and four hyphens). For example:
>
> 123e4567-e89b-12d3-a456-426655440000
>
> Instead generates this:
>
> _PNnQffT1EeSYNfDWIQWDJg
>
>
>
>
Re: EcoreUtil.generateUUID() [message #1697160 is a reply to message #1697156] Tue, 02 June 2015 06:17 Go to previous messageGo to next message
Thomas Schindl is currently online Thomas SchindlFriend
Messages: 6505
Registered: July 2009
Senior Member
Hi,

I always thought this is because an ID in the XML world is not supposed
to start with a number?

Tom

On 02.06.15 06:54, Ed Merks wrote:
> Al,
>
> Because it was always that way. :-P
>
> It's hard to believe EMF is 15 years old and existed as a MOF
> implementation at IBM even before that. I don't recall exactly why we
> took this form, but two considerations are clear:
>
> One uses 36 characters the other 23, so so the choice made takes 2/3
> as much memory to represent. It's still sad that 8 bytes of information
> takes uses almost 90 bytes to represent, but XMI allows arbitrary IDs...
> One is not an xmi:ID and the other is. It seems good that an ID be an
> xsd:ID.
>
> In any case, the irony of a universally unique identifier is that to the
> human eye, they're no better than a blurry eye chart.
>
>
> On 01/06/2015 7:51 PM, Al B wrote:
>> Can someone remind me why the EcoreUtil.generateUUID() doesn't
>> generate UUIDs in five group numbers separated by hyphens, in the form
>> 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters
>> and four hyphens). For example:
>>
>> 123e4567-e89b-12d3-a456-426655440000
>>
>> Instead generates this:
>>
>> _PNnQffT1EeSYNfDWIQWDJg
>>
>>
>>
>>
>
Re: EcoreUtil.generateUUID() [message #1697185 is a reply to message #1697160] Tue, 02 June 2015 08:32 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30554
Registered: July 2009
Senior Member
Tom,

Yes ID must be an NCName and that can't start with a number. That's
what I mean by "One is not an ID"...


On 02/06/2015 8:17 AM, Tom Schindl wrote:
> Hi,
>
> I always thought this is because an ID in the XML world is not supposed
> to start with a number?
>
> Tom
>
> On 02.06.15 06:54, Ed Merks wrote:
>> Al,
>>
>> Because it was always that way. :-P
>>
>> It's hard to believe EMF is 15 years old and existed as a MOF
>> implementation at IBM even before that. I don't recall exactly why we
>> took this form, but two considerations are clear:
>>
>> One uses 36 characters the other 23, so so the choice made takes 2/3
>> as much memory to represent. It's still sad that 8 bytes of information
>> takes uses almost 90 bytes to represent, but XMI allows arbitrary IDs...
>> One is not an xmi:ID and the other is. It seems good that an ID be an
>> xsd:ID.
>>
>> In any case, the irony of a universally unique identifier is that to the
>> human eye, they're no better than a blurry eye chart.
>>
>>
>> On 01/06/2015 7:51 PM, Al B wrote:
>>> Can someone remind me why the EcoreUtil.generateUUID() doesn't
>>> generate UUIDs in five group numbers separated by hyphens, in the form
>>> 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters
>>> and four hyphens). For example:
>>>
>>> 123e4567-e89b-12d3-a456-426655440000
>>>
>>> Instead generates this:
>>>
>>> _PNnQffT1EeSYNfDWIQWDJg
>>>
>>>
>>>
>>>
Previous Topic:XSDEcoreBuilder / EcoreRefletive Editor : Strange behavior with xsd:element without typetype
Next Topic:ClassifierId across different but related models
Goto Forum:
  


Current Time: Tue Oct 22 05:58:48 GMT 2019

Powered by FUDForum. Page generated in 0.03497 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top