Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Generating XMI with UUIDs
Generating XMI with UUIDs [message #390179] Sun, 26 December 2004 22:10 Go to next message
Hayden Marchant is currently offline Hayden MarchantFriend
Messages: 90
Registered: July 2009
Member
When I was using the default XMIResourceImpl to persist my model, I was
getting internal object references resolved like "/i", where 'i' was the
index of the object in the document. This is not inline with how a lot of
XMI references are resolved in various XMI standards. They normally have
xmi:id attributes, and references are to those ids.

After looking through the source code I noticed the useUuids() method. I
overode this method to return 'true' and my XMI suddenly looked a lot more
'standard'. Is this the correct way to get such functionality? If I can do
this, it means that I can use EMF to parse various vendor-specific XMI
files since they generally resolve ids in this manner.

Thanks,
Re: Generating XMI with UUIDs [message #390182 is a reply to message #390179] Mon, 27 December 2004 14:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 26285
Registered: July 2009
Senior Member
Hayden,

When the useUUIDs method returns true, it will be assumed that the IDs
of objects in the resource are universally unique. Any object removed
from the resource will still remember its UUID and any object attached
to the resource will be assigned a generated UUID, if it doesn't already
have a remembered UUID. Changing this method will have no impact on how
a "standard" XMI file will be parsed. I.e., if the input has UUIDs and
has references to them, those will work regardless of this setting.
The important impact of changing this method is to ensure that every
object is assigned a UUID without having to call XMLResource.setID
explicitly to achieve that. UUIDs are very powerful but tend to cause
unsightly bloating.


Hayden Marchant wrote:

> When I was using the default XMIResourceImpl to persist my model, I
> was getting internal object references resolved like "/i", where 'i'
> was the index of the object in the document. This is not inline with
> how a lot of XMI references are resolved in various XMI standards.
> They normally have xmi:id attributes, and references are to those ids.
> After looking through the source code I noticed the useUuids() method.
> I overode this method to return 'true' and my XMI suddenly looked a
> lot more 'standard'. Is this the correct way to get such
> functionality? If I can do this, it means that I can use EMF to parse
> various vendor-specific XMI files since they generally resolve ids in
> this manner.
>
> Thanks,
Previous Topic:Generating XML instances from an XSD
Next Topic:xsd-ecore-sdo Together
Goto Forum:
  


Current Time: Sat Dec 20 13:43:55 GMT 2014

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

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