Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » adding extra information into foreign emf model
adding extra information into foreign emf model [message #415200] Wed, 05 December 2007 09:30 Go to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 64
Registered: July 2009
Member
Hi Ed,

exists there a way to put own extra data into a foreign emf model?

I want to refer to elements of an anonymous emf model that exists
somewhere in my workspace and store additional relationship information
that belongs to another foreign model (mapping). Since I have no
guarantee that the foreign model elements has an ID, I can't use the URI
to address the target eObjects uniquely. (The URI might contain a "@x"
address, which points to the wrong target, if the container elements of
the targets container changes). So I had the idea to put an own
meta-data ID at the target object and let the original generated
ResourceImpl maintain this additional data. I could live with the
precondition that a solution would work only for xml/xmi based resources.

Thanks in advance.
Sven
Re: adding extra information into foreign emf model [message #415203 is a reply to message #415200] Wed, 05 December 2007 12:05 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Sven,

An XMLResourceImpl specialized to return true for useUUIDs will assign
unique IDs to objects as the are attached to the resource and will
maintain a two way mapping between that object and its UUID. That
sounds like what you need in this case.


Sven Krause wrote:
> Hi Ed,
>
> exists there a way to put own extra data into a foreign emf model?
>
> I want to refer to elements of an anonymous emf model that exists
> somewhere in my workspace and store additional relationship
> information that belongs to another foreign model (mapping). Since I
> have no guarantee that the foreign model elements has an ID, I can't
> use the URI to address the target eObjects uniquely. (The URI might
> contain a "@x" address, which points to the wrong target, if the
> container elements of the targets container changes). So I had the
> idea to put an own meta-data ID at the target object and let the
> original generated ResourceImpl maintain this additional data. I could
> live with the precondition that a solution would work only for xml/xmi
> based resources.
>
> Thanks in advance.
> Sven


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: adding extra information into foreign emf model [message #415215 is a reply to message #415203] Wed, 05 December 2007 15:11 Go to previous messageGo to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 64
Registered: July 2009
Member
Ed,

the problem is that I need to refer to elements those are not ID
elements and so don't have a UUID neither. Additionally, I can't change
the behavior of a foreign resource impl class without raising potential
problems at the original user of the resource class. I want just let the
foreign model "transport" my additional data.

Is this possible for eObjects extending the EModelElement only?

Sven

Ed Merks wrote:
> Sven,
>
> An XMLResourceImpl specialized to return true for useUUIDs will assign
> unique IDs to objects as the are attached to the resource and will
> maintain a two way mapping between that object and its UUID. That
> sounds like what you need in this case.
>
>
> Sven Krause wrote:
>> Hi Ed,
>>
>> exists there a way to put own extra data into a foreign emf model?
>>
>> I want to refer to elements of an anonymous emf model that exists
>> somewhere in my workspace and store additional relationship
>> information that belongs to another foreign model (mapping). Since I
>> have no guarantee that the foreign model elements has an ID, I can't
>> use the URI to address the target eObjects uniquely. (The URI might
>> contain a "@x" address, which points to the wrong target, if the
>> container elements of the targets container changes). So I had the
>> idea to put an own meta-data ID at the target object and let the
>> original generated ResourceImpl maintain this additional data. I
>> could live with the precondition that a solution would work only for
>> xml/xmi based resources.
>>
>> Thanks in advance.
>> Sven
Re: adding extra information into foreign emf model [message #415216 is a reply to message #415215] Wed, 05 December 2007 15:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Sven,

Comments below.


Sven Krause wrote:
> Ed,
>
> the problem is that I need to refer to elements those are not ID
> elements and so don't have a UUID neither.
I know. The UUID is maintained by the resource not as actual state
within the object. I.e., it's what I refer to as an extrinsic ID rather
than an intrinsic ID.
> Additionally, I can't change the behavior of a foreign resource impl
> class without raising potential problems at the original user of the
> resource class.
That's more of a problem then.
> I want just let the foreign model "transport" my additional data.
I'm a bit confused though because unless you actually change what's
serialized in the foreign model, how would you expect this information
to be associated with that model. Of course it could be stored as a
separate file that maps the two, but then you are back to the original
problem of referencing into a model that doesn't have references that
are stable with respect to structural changes.
>
> Is this possible for eObjects extending the EModelElement only?
Meaning using EAnnotations? Certainly any model could make use of an
annotation type of design, but that still affects what data is
serialized for that model and I though that you needed to avoid that.
I'm a bit confused about the actual constraints on the solutions that
will be acceptable...
>
> Sven
>
> Ed Merks wrote:
>> Sven,
>>
>> An XMLResourceImpl specialized to return true for useUUIDs will
>> assign unique IDs to objects as the are attached to the resource and
>> will maintain a two way mapping between that object and its UUID.
>> That sounds like what you need in this case.
>>
>>
>> Sven Krause wrote:
>>> Hi Ed,
>>>
>>> exists there a way to put own extra data into a foreign emf model?
>>>
>>> I want to refer to elements of an anonymous emf model that exists
>>> somewhere in my workspace and store additional relationship
>>> information that belongs to another foreign model (mapping). Since I
>>> have no guarantee that the foreign model elements has an ID, I can't
>>> use the URI to address the target eObjects uniquely. (The URI might
>>> contain a "@x" address, which points to the wrong target, if the
>>> container elements of the targets container changes). So I had the
>>> idea to put an own meta-data ID at the target object and let the
>>> original generated ResourceImpl maintain this additional data. I
>>> could live with the precondition that a solution would work only for
>>> xml/xmi based resources.
>>>
>>> Thanks in advance.
>>> Sven


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: adding extra information into foreign emf model [message #415218 is a reply to message #415216] Wed, 05 December 2007 15:55 Go to previous messageGo to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 64
Registered: July 2009
Member
Ed,

Answers below.

Ed Merks wrote:
> Sven,
>
> Comments below.
>
>
> Sven Krause wrote:
>> Ed,
>>
>> the problem is that I need to refer to elements those are not ID
>> elements and so don't have a UUID neither.
> I know. The UUID is maintained by the resource not as actual state
> within the object. I.e., it's what I refer to as an extrinsic ID
> rather than an intrinsic ID.
>> Additionally, I can't change the behavior of a foreign resource impl
>> class without raising potential problems at the original user of the
>> resource class.
> That's more of a problem then.
>> I want just let the foreign model "transport" my additional data.
> I'm a bit confused though because unless you actually change what's
> serialized in the foreign model, how would you expect this information
> to be associated with that model. Of course it could be stored as a
> separate file that maps the two, but then you are back to the original
> problem of referencing into a model that doesn't have references that
> are stable with respect to structural changes.
Thats exact my question. How could I convince the model provider to
store data for me without changing its behavior? I would put my ID as
hint to the element and trust that even, if the element is moved my ID
moves together as long the element will not copied. I know the
performance is not the best to find the element again, but I can
optimize this using access strategies using a combination of URI and my ID.
>>
>> Is this possible for eObjects extending the EModelElement only?
> Meaning using EAnnotations? Certainly any model could make use of an
> annotation type of design, but that still affects what data is
> serialized for that model and I though that you needed to avoid that.
> I'm a bit confused about the actual constraints on the solutions that
> will be acceptable...
Yes. Using annotations would let me add data into the model without
effecting the original user of the model.
>>
>> Sven
>>
>> Ed Merks wrote:
>>> Sven,
>>>
>>> An XMLResourceImpl specialized to return true for useUUIDs will
>>> assign unique IDs to objects as the are attached to the resource and
>>> will maintain a two way mapping between that object and its UUID.
>>> That sounds like what you need in this case.
>>>
>>>
>>> Sven Krause wrote:
>>>> Hi Ed,
>>>>
>>>> exists there a way to put own extra data into a foreign emf model?
>>>>
>>>> I want to refer to elements of an anonymous emf model that exists
>>>> somewhere in my workspace and store additional relationship
>>>> information that belongs to another foreign model (mapping). Since
>>>> I have no guarantee that the foreign model elements has an ID, I
>>>> can't use the URI to address the target eObjects uniquely. (The URI
>>>> might contain a "@x" address, which points to the wrong target, if
>>>> the container elements of the targets container changes). So I had
>>>> the idea to put an own meta-data ID at the target object and let
>>>> the original generated ResourceImpl maintain this additional data.
>>>> I could live with the precondition that a solution would work only
>>>> for xml/xmi based resources.
>>>>
>>>> Thanks in advance.
>>>> Sven
Re: adding extra information into foreign emf model [message #415221 is a reply to message #415218] Wed, 05 December 2007 16:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Sven

It seems you must convince the owner of the model to do something,
right? Either he has to change the model to carry and ID attribute,
change the model to allow it to be extended, or change the resource
implementation to produce more robust URI fragments. The easiest
change is to use a resource that assigns UUIDs. This will create no
incompatibility problems for older serializations and has exactly the
property you want...

Sven Krause wrote:
> Ed,
>
> Answers below.
>
> Ed Merks wrote:
>> Sven,
>>
>> Comments below.
>>
>>
>> Sven Krause wrote:
>>> Ed,
>>>
>>> the problem is that I need to refer to elements those are not ID
>>> elements and so don't have a UUID neither.
>> I know. The UUID is maintained by the resource not as actual state
>> within the object. I.e., it's what I refer to as an extrinsic ID
>> rather than an intrinsic ID.
>>> Additionally, I can't change the behavior of a foreign resource impl
>>> class without raising potential problems at the original user of the
>>> resource class.
>> That's more of a problem then.
>>> I want just let the foreign model "transport" my additional data.
>> I'm a bit confused though because unless you actually change what's
>> serialized in the foreign model, how would you expect this
>> information to be associated with that model. Of course it could be
>> stored as a separate file that maps the two, but then you are back to
>> the original problem of referencing into a model that doesn't have
>> references that are stable with respect to structural changes.
> Thats exact my question. How could I convince the model provider to
> store data for me without changing its behavior? I would put my ID as
> hint to the element and trust that even, if the element is moved my ID
> moves together as long the element will not copied. I know the
> performance is not the best to find the element again, but I can
> optimize this using access strategies using a combination of URI and
> my ID.
>>>
>>> Is this possible for eObjects extending the EModelElement only?
>> Meaning using EAnnotations? Certainly any model could make use of an
>> annotation type of design, but that still affects what data is
>> serialized for that model and I though that you needed to avoid
>> that. I'm a bit confused about the actual constraints on the
>> solutions that will be acceptable...
> Yes. Using annotations would let me add data into the model without
> effecting the original user of the model.
>>>
>>> Sven
>>>
>>> Ed Merks wrote:
>>>> Sven,
>>>>
>>>> An XMLResourceImpl specialized to return true for useUUIDs will
>>>> assign unique IDs to objects as the are attached to the resource
>>>> and will maintain a two way mapping between that object and its
>>>> UUID. That sounds like what you need in this case.
>>>>
>>>>
>>>> Sven Krause wrote:
>>>>> Hi Ed,
>>>>>
>>>>> exists there a way to put own extra data into a foreign emf model?
>>>>>
>>>>> I want to refer to elements of an anonymous emf model that exists
>>>>> somewhere in my workspace and store additional relationship
>>>>> information that belongs to another foreign model (mapping). Since
>>>>> I have no guarantee that the foreign model elements has an ID, I
>>>>> can't use the URI to address the target eObjects uniquely. (The
>>>>> URI might contain a "@x" address, which points to the wrong
>>>>> target, if the container elements of the targets container
>>>>> changes). So I had the idea to put an own meta-data ID at the
>>>>> target object and let the original generated ResourceImpl maintain
>>>>> this additional data. I could live with the precondition that a
>>>>> solution would work only for xml/xmi based resources.
>>>>>
>>>>> Thanks in advance.
>>>>> Sven


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: adding extra information into foreign emf model [message #415227 is a reply to message #415221] Wed, 05 December 2007 19:17 Go to previous message
Sven Krause is currently offline Sven KrauseFriend
Messages: 64
Registered: July 2009
Member
OK, Thanks.
Previous Topic:Fully qualified package name
Next Topic:Escape for XML-Serialization not works
Goto Forum:
  


Current Time: Sat Apr 27 04:56:13 GMT 2024

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

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

Back to the top