Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMFStore] Model updates on client and server side
[EMFStore] Model updates on client and server side [message #1284320] Fri, 04 April 2014 10:35 Go to next message
Kristof Zalecki is currently offline Kristof ZaleckiFriend
Messages: 23
Registered: October 2013
Junior Member
Hi,

I am currently working on a rather large project which is followed by
regular changes at the core of the model.
Now every time one of these changes is made I would like to keep the old
version of my model in the main line of emfstore repository and the new
version should be stored in a branch (but still in the same emfstore
project).
To do so I tried to deploy my model with versions in the package name
like "com.example.modelV1.myModelEclipseProject" and
"com.example.modelV2.myModelEclipseProject" and then tried to adapt this
in the namespace of the .ecp files on client and server side.
Of course this kind of hack is only for testing purposes, but what I end
up with are checksum errors, since the changed model version is
generating a different checksum after all.
(I am also deploying the models on my server as plugins so the server is
able to use them, which is working fine when I create seperate projects
with those seperate versions).

My question is now, if there is any reasonable way to get this done or
if anyone has an idea on how to do this right (more or less).

I'd appreciate any help since this is a very important part of my project!

Thanks and regards,
Kristof
Re: [EMFStore] Model updates on client and server side [message #1286968 is a reply to message #1284320] Mon, 07 April 2014 08:44 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi Kristof,

I am not really sure if this a good way to do it, but maybe/probably I
do not fully understand your requirements...;).
If you want to keep both the new and the old version of the Ecore AND
its instances, it would seem strange to me to just change the namespaces
for existing data (project versions), I would suggest something different.
From my point of view you should create a branch from the current head
version of the project and then migrate the involved entities to the new
Ecore version in that branch by creating new EObjects conforming to the
new Ecore and deleting old EObjects conforming to the old Ecore. This
way the repository is aware of what you are doing and I would expect no
problems.
Hope this helps!

Cheers,
Maximilian


Am 04.04.2014 12:35, schrieb Zalecki, Kristof:
> Hi,
>
> I am currently working on a rather large project which is followed by
> regular changes at the core of the model.
> Now every time one of these changes is made I would like to keep the old
> version of my model in the main line of emfstore repository and the new
> version should be stored in a branch (but still in the same emfstore
> project).
> To do so I tried to deploy my model with versions in the package name
> like "com.example.modelV1.myModelEclipseProject" and
> "com.example.modelV2.myModelEclipseProject" and then tried to adapt this
> in the namespace of the .ecp files on client and server side.
> Of course this kind of hack is only for testing purposes, but what I end
> up with are checksum errors, since the changed model version is
> generating a different checksum after all.
> (I am also deploying the models on my server as plugins so the server is
> able to use them, which is working fine when I create seperate projects
> with those seperate versions).
>
> My question is now, if there is any reasonable way to get this done or
> if anyone has an idea on how to do this right (more or less).
>
> I'd appreciate any help since this is a very important part of my project!
>
> Thanks and regards,
> Kristof


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: [EMFStore] Model updates on client and server side [message #1287018 is a reply to message #1286968] Mon, 07 April 2014 09:51 Go to previous messageGo to next message
Kristof Zalecki is currently offline Kristof ZaleckiFriend
Messages: 23
Registered: October 2013
Junior Member
Hi Maximilian,

thanks for the reply. Your recommendation sounds much more logical than
my approach (which felt more like dividing by zero) :)
Since my project is rather large, I will try to get those changes done
automated with some sort of plugin or a plain java class.

Regards,
Kristof


Am 07.04.2014 10:44, schrieb Maximilian Koegel:
> Hi Kristof,
>
> I am not really sure if this a good way to do it, but maybe/probably I
> do not fully understand your requirements...;).
> If you want to keep both the new and the old version of the Ecore AND
> its instances, it would seem strange to me to just change the namespaces
> for existing data (project versions), I would suggest something different.
> From my point of view you should create a branch from the current head
> version of the project and then migrate the involved entities to the new
> Ecore version in that branch by creating new EObjects conforming to the
> new Ecore and deleting old EObjects conforming to the old Ecore. This
> way the repository is aware of what you are doing and I would expect no
> problems.
> Hope this helps!
>
> Cheers,
> Maximilian
>
>
> Am 04.04.2014 12:35, schrieb Zalecki, Kristof:
>> Hi,
>>
>> I am currently working on a rather large project which is followed by
>> regular changes at the core of the model.
>> Now every time one of these changes is made I would like to keep the old
>> version of my model in the main line of emfstore repository and the new
>> version should be stored in a branch (but still in the same emfstore
>> project).
>> To do so I tried to deploy my model with versions in the package name
>> like "com.example.modelV1.myModelEclipseProject" and
>> "com.example.modelV2.myModelEclipseProject" and then tried to adapt this
>> in the namespace of the .ecp files on client and server side.
>> Of course this kind of hack is only for testing purposes, but what I end
>> up with are checksum errors, since the changed model version is
>> generating a different checksum after all.
>> (I am also deploying the models on my server as plugins so the server is
>> able to use them, which is working fine when I create seperate projects
>> with those seperate versions).
>>
>> My question is now, if there is any reasonable way to get this done or
>> if anyone has an idea on how to do this right (more or less).
>>
>> I'd appreciate any help since this is a very important part of my project!
>>
>> Thanks and regards,
>> Kristof
>
>
Re: [EMFStore] Model updates on client and server side [message #1290877 is a reply to message #1287018] Thu, 10 April 2014 14:11 Go to previous messageGo to next message
Kristof Zalecki is currently offline Kristof ZaleckiFriend
Messages: 23
Registered: October 2013
Junior Member
Hi Maximilian,

following your advice I came across a few more problems regarding the
model update on my client and server.
Since my project is pretty large (at least a few tenthousand model
instances) a manual update is not feasible at all.
What I am trying now is to create a method which would run down the
project tree and recreate a new one based on the old one with the new
model version. This needs to be done automatically after creation of the
branch and my idea was to be able to choose the right model version from
a list in the branch creation dialog.
The problem is that I don't know how to do this generically inside of a
method (passing the class or name of the class as a parameter) and to
create new EObjects based on the new model version generically.
Another problem would be that the model IDs will also change which would
complicate things more.

Do you have any suggenstions on that? (at least on the first part)

Thanks in advance and best regards,
Kristof
Re: [EMFStore] Model updates on client and server side [message #1290948 is a reply to message #1290877] Thu, 10 April 2014 15:28 Go to previous messageGo to next message
Maximilian Koegel is currently offline Maximilian KoegelFriend
Messages: 253
Registered: July 2009
Senior Member
Hi Kristof,

I would expect that you add an action to the UI which first creates a
new branch (either by reusing the existing UI or by API), than runs the
automatic migration of the entities and finally perhaps even triggers a
commit to the newly created branch. Does this sound reasonable?
Concerning the changing model element IDs I tend to think it is good
that they have a new ID since the new objects are really new from my
point of view and also conform to a new EClass. However technically you
could do the following involving the use of internal "API":
1. During migration you create mapping from oldObject to newObject and
to ID and you do NOT yet insert the newObjects into the project but keep
them in memory only.
2. You remove all oldObjects from the project AND commit the resulting
changes (now the project is empty)
3. You can preassign IDs with the following method, before you actually
add the migrated newObjects to the project. To be able to access this
API you need to downcast an ESLocalProject to ESLocalProjectImpl and
make the following call on it:
toInternalAPI().getProject().allocateModelElementIds(Map<EObject,
ModelElementId> modelElementToIdMap) with a map from your EObjects to
their intended IDs.
If you need this method exposed in the API, we would definitely accept a
contribution exposing it in ESLocalProject...;)
Hope this helps!

Cheers,
Maximilian


Am 10.04.2014 16:11, schrieb Zalecki, Kristof:
> Hi Maximilian,
>
> following your advice I came across a few more problems regarding the
> model update on my client and server.
> Since my project is pretty large (at least a few tenthousand model
> instances) a manual update is not feasible at all.
> What I am trying now is to create a method which would run down the
> project tree and recreate a new one based on the old one with the new
> model version. This needs to be done automatically after creation of the
> branch and my idea was to be able to choose the right model version from
> a list in the branch creation dialog.
> The problem is that I don't know how to do this generically inside of a
> method (passing the class or name of the class as a parameter) and to
> create new EObjects based on the new model version generically.
> Another problem would be that the model IDs will also change which would
> complicate things more.
>
> Do you have any suggenstions on that? (at least on the first part)
>
> Thanks in advance and best regards,
> Kristof
>


--
Maximilian Kögel

Get Professional Eclipse Support: http://eclipsesource.com/munich
Re: [EMFStore] Model updates on client and server side [message #1295367 is a reply to message #1290948] Mon, 14 April 2014 07:50 Go to previous message
Kristof Zalecki is currently offline Kristof ZaleckiFriend
Messages: 23
Registered: October 2013
Junior Member
Hi Maximilian,

thanks for the great answer. I will try to get this working. If anything
of use comes out I will be glad to share it :)

Regards,
Kristof


Am 10.04.2014 17:28, schrieb Maximilian Koegel:
> Hi Kristof,
>
> I would expect that you add an action to the UI which first creates a
> new branch (either by reusing the existing UI or by API), than runs the
> automatic migration of the entities and finally perhaps even triggers a
> commit to the newly created branch. Does this sound reasonable?
> Concerning the changing model element IDs I tend to think it is good
> that they have a new ID since the new objects are really new from my
> point of view and also conform to a new EClass. However technically you
> could do the following involving the use of internal "API":
> 1. During migration you create mapping from oldObject to newObject and
> to ID and you do NOT yet insert the newObjects into the project but keep
> them in memory only.
> 2. You remove all oldObjects from the project AND commit the resulting
> changes (now the project is empty)
> 3. You can preassign IDs with the following method, before you actually
> add the migrated newObjects to the project. To be able to access this
> API you need to downcast an ESLocalProject to ESLocalProjectImpl and
> make the following call on it:
> toInternalAPI().getProject().allocateModelElementIds(Map<EObject,
> ModelElementId> modelElementToIdMap) with a map from your EObjects to
> their intended IDs.
> If you need this method exposed in the API, we would definitely accept a
> contribution exposing it in ESLocalProject...;)
> Hope this helps!
>
> Cheers,
> Maximilian
>
>
> Am 10.04.2014 16:11, schrieb Zalecki, Kristof:
>> Hi Maximilian,
>>
>> following your advice I came across a few more problems regarding the
>> model update on my client and server.
>> Since my project is pretty large (at least a few tenthousand model
>> instances) a manual update is not feasible at all.
>> What I am trying now is to create a method which would run down the
>> project tree and recreate a new one based on the old one with the new
>> model version. This needs to be done automatically after creation of the
>> branch and my idea was to be able to choose the right model version from
>> a list in the branch creation dialog.
>> The problem is that I don't know how to do this generically inside of a
>> method (passing the class or name of the class as a parameter) and to
>> create new EObjects based on the new model version generically.
>> Another problem would be that the model IDs will also change which would
>> complicate things more.
>>
>> Do you have any suggenstions on that? (at least on the first part)
>>
>> Thanks in advance and best regards,
>> Kristof
>>
>
>
Previous Topic:[EMF Facet] Need Tutorial on how to use Facet
Next Topic:[EMF Forms] Receive notifications of rendered form
Goto Forum:
  


Current Time: Tue Mar 09 04:03:09 GMT 2021

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

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

Back to the top