Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EDataGraph for Subparts of SDO
EDataGraph for Subparts of SDO [message #401472] Thu, 01 June 2006 09:04 Go to next message
Eclipse UserFriend
Originally posted by: jens.mittag.prime23.de

Hi!

In my model, I have a root object, which contains a few child objects.
Now, I would like to put each of these child objects into an EDataGraph
- no problem so far. But when I serialize such an EDataGraph, all
siblings are serialized into the XML file as well. How can I prevent this?

The idea behind this is: I want to be able to track changes on the whole
model, and on specific subparts. So, when I want the changes of a
subpart, I only get those changes.

Thanks in advance.
Re: EDataGraph for Subparts of SDO [message #401475 is a reply to message #401472] Thu, 01 June 2006 11:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

Things that you want serialized separately need to be in separate
resources. You could just attach a ChangeRecorder to the root of any
subtree and record only the changes within that...


Jens Mittag wrote:
> Hi!
>
> In my model, I have a root object, which contains a few child objects.
> Now, I would like to put each of these child objects into an
> EDataGraph - no problem so far. But when I serialize such an
> EDataGraph, all siblings are serialized into the XML file as well. How
> can I prevent this?
>
> The idea behind this is: I want to be able to track changes on the
> whole model, and on specific subparts. So, when I want the changes of
> a subpart, I only get those changes.
>
> Thanks in advance.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EDataGraph for Subparts of SDO [message #401476 is a reply to message #401475] Thu, 01 June 2006 12:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jens.mittag.prime23.de

Hmm...

Does this imply that the root object doesn't have a reference to its
children? ...or do I only have to remove the containment for the
association?

Imagine the following situation:

root-object -> child #1
-> child #2


If I do not use containment for the association, child#1 and child#2 are
in their own Resource and can be serialized seperately. If I want to
serialize the root-obj. with all the cildren, I do
root.eResource().getContents().add(child); for each child and then save
it. Or how would you do this?

Thanks
Jens

Ed Merks wrote:
> Jens,
>
> Things that you want serialized separately need to be in separate
> resources. You could just attach a ChangeRecorder to the root of any
> subtree and record only the changes within that...
>
>
> Jens Mittag wrote:
>
>> Hi!
>>
>> In my model, I have a root object, which contains a few child objects.
>> Now, I would like to put each of these child objects into an
>> EDataGraph - no problem so far. But when I serialize such an
>> EDataGraph, all siblings are serialized into the XML file as well. How
>> can I prevent this?
>>
>> The idea behind this is: I want to be able to track changes on the
>> whole model, and on specific subparts. So, when I want the changes of
>> a subpart, I only get those changes.
>>
>> Thanks in advance.
Re: EDataGraph for Subparts of SDO [message #401477 is a reply to message #401476] Thu, 01 June 2006 12:37 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
Jens,

In EMF 2.2 there is support for cross resource containment as well
(EReference.resolveProxies set to true and GenModel's Contaiment Proxies
property set to true) so that child #1 could be in a separate resource
or, if it's not, it will be serialized as a child of root-object. The
approach of using a non-containment resource you outline would work too.


Jens Mittag wrote:
> Hmm...
>
> Does this imply that the root object doesn't have a reference to its
> children? ...or do I only have to remove the containment for the
> association?
>
> Imagine the following situation:
>
> root-object -> child #1
> -> child #2
>
>
> If I do not use containment for the association, child#1 and child#2
> are in their own Resource and can be serialized seperately. If I want
> to serialize the root-obj. with all the cildren, I do
> root.eResource().getContents().add(child); for each child and then
> save it. Or how would you do this?
>
> Thanks
> Jens
>
> Ed Merks wrote:
>> Jens,
>>
>> Things that you want serialized separately need to be in separate
>> resources. You could just attach a ChangeRecorder to the root of any
>> subtree and record only the changes within that...
>>
>>
>> Jens Mittag wrote:
>>
>>> Hi!
>>>
>>> In my model, I have a root object, which contains a few child
>>> objects. Now, I would like to put each of these child objects into
>>> an EDataGraph - no problem so far. But when I serialize such an
>>> EDataGraph, all siblings are serialized into the XML file as well.
>>> How can I prevent this?
>>>
>>> The idea behind this is: I want to be able to track changes on the
>>> whole model, and on specific subparts. So, when I want the changes
>>> of a subpart, I only get those changes.
>>>
>>> Thanks in advance.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Announce] EMF 2.2.0 I200606010000 is available
Next Topic:Use of adapter pattern in EMF codegen
Goto Forum:
  


Current Time: Fri Apr 26 04:40:50 GMT 2024

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

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

Back to the top