Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » Matching eObject with containemt(1-*) reference
| |
Re: [EMF Compare] Matching eObject with containemt(1-*) reference [message #131377 is a reply to message #131166] |
Fri, 05 December 2008 12:44 |
Cedric Brun Messages: 431 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm not sure to really understand what you want to do. That said, you can specialize the diff engine to show different kind of differences deduced from the original ones, and then extends the merge service so that it can be merged by the user. So if that's what you're trying to do, then no need to specialize the match engine.
If you want to "force" emf compare to consider your Class1 is the same as the Class2, then you need to specialize the match engine so that you say "this Class1 *matches* this Class2. Then the differences that will show up will consider that Class1/Class2 are 2 versions of the same object and then you'll be able to merge your Students.
Is that what you're trying to do ?
Cédric
Chetan Kumar wrote:
> Just changed the subject ... so that its more specific :)
> Chetan Kumar wrote:
>
>> Hello people,
>> I am trying to merge root EObjects based on the same metamodel. The
>> merger i am looking for is just like CVS synchronize. I have incoming
>> changes that have to be included under an existing parent. More on these
>> i'll try to explin thru the example:
>> I have an example model like:
>> Class
>> |
>> |--- students (1-*)
>
>> Student
>> |
>> |--- name: String
>> |--- reg_id: Integer
>
>> I have 2 instances of the Class objects with 2 different student
>> objects. When i say different, the attributes of the Student instance is
>> different.
>
>> I want to merge these 2 different Class instances into one. Ultimately
>> i want the different students included under the single Class instance.
>> Something like "incoming-changes" in CVS synchronize.
>
>> I tried to use the Diff amd Match services, and in the CompareUI that
>> was up ... the 2 Class instances on left and right showed up changes in
>> child Student objects. That's fine. But i wanted to take the Student
>> object from the right side and add it under the left side's Class
>> instance. Something like "incoming_changes" in CVS synch.
>
>> Should i extend the Match or the Diff Service to detect such a diff
>> and
>> merge it ?
>
>> thanks,
>> Chetan Kumar
http://cedric.brun.io news and articles on eclipse and eclipse modeling.
|
|
|
Re: [EMF Compare] Matching eObject with containemt(1-*) reference [message #131438 is a reply to message #131377] |
Mon, 08 December 2008 06:44 |
Chetan Kumar Messages: 70 Registered: July 2009 |
Member |
|
|
Cédric,
I think i have to specialize the diff and merge engines. Before that i
wanted to make sure i don't unnecessarily specialize it.
Coming back to my requirement, i want to merge 2 similar objects (their
similarity is eshtablished thru an ID attribute let's say.) These similar
objects have containment relationships (0-*) of some child type(Student).
Both the similar parent objects have conflicting child containers based on
the above containment type. This is shown as a conflict properly but i
want more options while merging.
Options like: ignore changes from the right parent object, override the
left side parent object with changes from the right parent object, append
changes from the right parent objects to the left parent object. My
question was to have such options ... is it already possible thru existing
Merge ? or should i have to use the extension-point and write my merge
engine ?
Containers in my model can have more than one attribute that can be
called as an ID - for instance, an integer attribute, an enumeration, and
a cross-reference combined describe a container's identity. How do i go
about DIFFing in these cases ?
thanks,
Chetan Kumar
Cédric Brun wrote:
> Hi,
> I'm not sure to really understand what you want to do. That said, you can
specialize the diff engine to show different kind of differences deduced from
the original ones, and then extends the merge service so that it can be merged
by the user. So if that's what you're trying to do, then no need to specialize
the match engine.
> If you want to "force" emf compare to consider your Class1 is the same as
the Class2, then you need to specialize the match engine so that you say "this
Class1 *matches* this Class2. Then the differences that will show up will
consider that Class1/Class2 are 2 versions of the same object and then you'll
be able to merge your Students.
> Is that what you're trying to do ?
> Cédric
|
|
|
Re: [EMF Compare] Matching eObject with containemt(1-*) reference [message #131464 is a reply to message #131438] |
Mon, 08 December 2008 09:40 |
|
This is a multi-part message in MIME format.
--------------090502090204090502030408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hi,
I still have trouble visualizing your metamodel and the changes you
describe. Could you provide us with a sample (metamodel and models)
reproducing this?
As for the merge options, no, the existing merge does not provide
advanced features. We could try and find a way to add them though if the
case you encouter is reproducible and meaningful as a generic solution.
The merge extension point should provide you with enough flexibility to
tackle this need nevertheless. Feel free to come back to us if it does not.
Having multiple attributes identifying an object is not an issue in
itself, yet the generic engines provided with EMF Compare probably
aren't sufficient to accurately detect differences on those. I think
what you need to override isn't the diff engine but the matching engine
so that EMF Compare knows how to match similar objects based on all ID
attributes. The generic diff engine should manage to diff accurately
afterwards.
laurent Goubet
Obeo
Chetan Kumar a
|
|
| | |
Re: [EMF Compare] Matching eObject with containemt(1-*) reference [message #620515 is a reply to message #131166] |
Fri, 05 December 2008 12:44 |
Cedric Brun Messages: 431 Registered: July 2009 |
Senior Member |
|
|
Hi,
I'm not sure to really understand what you want to do. That said, you can specialize the diff engine to show different kind of differences deduced from the original ones, and then extends the merge service so that it can be merged by the user. So if that's what you're trying to do, then no need to specialize the match engine.
If you want to "force" emf compare to consider your Class1 is the same as the Class2, then you need to specialize the match engine so that you say "this Class1 *matches* this Class2. Then the differences that will show up will consider that Class1/Class2 are 2 versions of the same object and then you'll be able to merge your Students.
Is that what you're trying to do ?
Cédric
Chetan Kumar wrote:
> Just changed the subject ... so that its more specific :)
> Chetan Kumar wrote:
>
>> Hello people,
>> I am trying to merge root EObjects based on the same metamodel. The
>> merger i am looking for is just like CVS synchronize. I have incoming
>> changes that have to be included under an existing parent. More on these
>> i'll try to explin thru the example:
>> I have an example model like:
>> Class
>> |
>> |--- students (1-*)
>
>> Student
>> |
>> |--- name: String
>> |--- reg_id: Integer
>
>> I have 2 instances of the Class objects with 2 different student
>> objects. When i say different, the attributes of the Student instance is
>> different.
>
>> I want to merge these 2 different Class instances into one. Ultimately
>> i want the different students included under the single Class instance.
>> Something like "incoming-changes" in CVS synchronize.
>
>> I tried to use the Diff amd Match services, and in the CompareUI that
>> was up ... the 2 Class instances on left and right showed up changes in
>> child Student objects. That's fine. But i wanted to take the Student
>> object from the right side and add it under the left side's Class
>> instance. Something like "incoming_changes" in CVS synch.
>
>> Should i extend the Match or the Diff Service to detect such a diff
>> and
>> merge it ?
>
>> thanks,
>> Chetan Kumar
http://cedric.brun.io news and articles on eclipse and eclipse modeling.
|
|
|
Re: [EMF Compare] Matching eObject with containemt(1-*) reference [message #620520 is a reply to message #131377] |
Mon, 08 December 2008 06:44 |
Chetan Kumar Messages: 70 Registered: July 2009 |
Member |
|
|
Cédric,
I think i have to specialize the diff and merge engines. Before that i
wanted to make sure i don't unnecessarily specialize it.
Coming back to my requirement, i want to merge 2 similar objects (their
similarity is eshtablished thru an ID attribute let's say.) These similar
objects have containment relationships (0-*) of some child type(Student).
Both the similar parent objects have conflicting child containers based on
the above containment type. This is shown as a conflict properly but i
want more options while merging.
Options like: ignore changes from the right parent object, override the
left side parent object with changes from the right parent object, append
changes from the right parent objects to the left parent object. My
question was to have such options ... is it already possible thru existing
Merge ? or should i have to use the extension-point and write my merge
engine ?
Containers in my model can have more than one attribute that can be
called as an ID - for instance, an integer attribute, an enumeration, and
a cross-reference combined describe a container's identity. How do i go
about DIFFing in these cases ?
thanks,
Chetan Kumar
Cédric Brun wrote:
> Hi,
> I'm not sure to really understand what you want to do. That said, you can
specialize the diff engine to show different kind of differences deduced from
the original ones, and then extends the merge service so that it can be merged
by the user. So if that's what you're trying to do, then no need to specialize
the match engine.
> If you want to "force" emf compare to consider your Class1 is the same as
the Class2, then you need to specialize the match engine so that you say "this
Class1 *matches* this Class2. Then the differences that will show up will
consider that Class1/Class2 are 2 versions of the same object and then you'll
be able to merge your Students.
> Is that what you're trying to do ?
> Cédric
|
|
|
Re: [EMF Compare] Matching eObject with containemt(1-*) reference [message #620522 is a reply to message #131438] |
Mon, 08 December 2008 09:40 |
|
This is a multi-part message in MIME format.
--------------090502090204090502030408
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hi,
I still have trouble visualizing your metamodel and the changes you
describe. Could you provide us with a sample (metamodel and models)
reproducing this?
As for the merge options, no, the existing merge does not provide
advanced features. We could try and find a way to add them though if the
case you encouter is reproducible and meaningful as a generic solution.
The merge extension point should provide you with enough flexibility to
tackle this need nevertheless. Feel free to come back to us if it does not.
Having multiple attributes identifying an object is not an issue in
itself, yet the generic engines provided with EMF Compare probably
aren't sufficient to accurately detect differences on those. I think
what you need to override isn't the diff engine but the matching engine
so that EMF Compare knows how to match similar objects based on all ID
attributes. The generic diff engine should manage to diff accurately
afterwards.
laurent Goubet
Obeo
Chetan Kumar a
|
|
| |
Goto Forum:
Current Time: Thu Apr 25 16:36:04 GMT 2024
Powered by FUDForum. Page generated in 0.04080 seconds
|