Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Object and discrepancy tolerance
EMF Object and discrepancy tolerance [message #1456657] Thu, 30 October 2014 15:37 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
I have been using java serialization for persisting my POJOs in files but now i need to store my POJOs in database and needs collaboration in my application so i have decided to use CDO.

If i have saved an EMF model (either in File or in DB using CDO) and i have to do alterations in my model like add/delete/rename attributes then will i able to retirve saved models properly from saved resources?

So to be concerete let's suppose i have an ecore model and i have many saved models in db using CDO

1 - if i add a new attribute to my ecore model and regenerate model then will i be able to retrieve old models properly?

2 - if i delete an attribute to my ecore model and regenerate model then will i be able to retrieve old models properly?

3 - if i rename an attribute to my ecore model and regenerate model then will i be able to retrieve old models properly?

thanks for helping....

Cheers,

[Updated on: Thu, 30 October 2014 15:37]

Report message to a moderator

Re: EMF Object and discrepancy tolerance [message #1456695 is a reply to message #1456657] Thu, 30 October 2014 16:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
Comments below

On 30/10/2014 4:37 PM, ModelGeek Mising name wrote:
> I have been using java serialization for persisting my POJOs in files
> but now i need to store my POJOs in database and needs collaboration
> in my application so i have decided to use CDO.
>
> If i have saved an EMF model (either in File or in DB using CDO) and i
> have to do alterations in my model like add/delete/rename attributes
> then will i able to retirve saved models properly from saved resources?
No, the model itself is saved in the data base and affects the data base
layout; it can't be altered.
>
> So to be concerete let's suppose i have an ecore model and i have many
> saved models in db using CDO
>
> 1 - if i add a new attribute to my ecore model and regenerate model
> then will i be able to retrieve old models properly?
No.
>
> 2 - if i delete an attribute to my ecore model and regenerate model
> then will i be able to retrieve old models properly?
No.
>
> 2 - if i rename an attribute to my ecore model and regenerate model
> then will i be able to retrieve old models properly?
No.
>
> thanks for helping....
This is the issue of model migration and is one of the few remaining
large features for CDO that's mostly unaddressed.
>
> Cheers,
Re: EMF Object and discrepancy tolerance [message #1460328 is a reply to message #1456695] Mon, 03 November 2014 12:57 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
thank you so much!

If we put the same question with respect to EMFStore?

1 - if i add a new attribute to my ecore model and regenerate code, will i able to retrieve model stored in EMFStore?
No.

2 - if i delete an attribute to my ecore model and regenerate code, will i able to retrieve model stored in EMFStore?

3 - if i rename an attribute to my ecore model and regenerate model code
then will i be able to retrieve old models properly?

I am trying to compare pros and cons for both CDO and EMFStore.

Thanks again!

Cheers,
Re: EMF Object and discrepancy tolerance [message #1460372 is a reply to message #1460328] Mon, 03 November 2014 13:51 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
EMFStore questions are generally answered on the EMFT forum so I'm not
sure they'll see it here...


On 03/11/2014 1:57 PM, ModelGeek Mising name wrote:
> thank you so much!
>
> If we put the same question with respect to EMFStore?
>
> 1 - if i add a new attribute to my ecore model and regenerate code,
> will i able to retrieve model stored in EMFStore?
> No.
>
> 2 - if i delete an attribute to my ecore model and regenerate code,
> will i able to retrieve model stored in EMFStore?
>
> 3 - if i rename an attribute to my ecore model and regenerate model code
> then will i be able to retrieve old models properly?
>
> I am trying to compare pros and cons for both CDO and EMFStore.
>
> Thanks again!
>
> Cheers,
Re: EMF Object and discrepancy tolerance [message #1461432 is a reply to message #1456695] Tue, 04 November 2014 14:59 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
thanks for support.

I have been looking foe different alternative to CDO... but CDO gives a lot of features which are very important to us.
For us it is important that when we add new properties to classes then objects saved using CDO remains retrievable... As you have said that it would be problematic and i have done some test which indicate the same phenomena... Is there any way we could solve this problem?

thanks again!

Cheers
Re: EMF Object and discrepancy tolerance [message #1461484 is a reply to message #1461432] Tue, 04 November 2014 16:05 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 04/11/2014 15:59, ModelGeek Mising name wrote:
> thanks for support.
>
> I have been looking foe different alternative to CDO... but CDO gives a
> lot of features which are very important to us.
> For us it is important that when we add new properties to classes then
> objects saved using CDO remains retrievable... As you have said that it
> would be problematic and i have done some test which indicate the same
> phenomena... Is there any way we could solve this problem?

Pragmatic (only?) approach is to export the model from CDO to say XMI,
migrate it somehow and then re-import it into CDO..

> thanks again!
>
> Cheers
Re: EMF Object and discrepancy tolerance [message #1461506 is a reply to message #1461484] Tue, 04 November 2014 16:29 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6538
Registered: July 2009
Senior Member
Hi

I think you are making your problem harder by considering it as a CDO
problem.

If you want to allow your metamodels to evolve you have two choices.

a) eager conversion to upgrade everything immediately

b) lazy conversion to upgrade on demand

Either way you have to code a conversion algorithm, which if you are
lucky may be as simple as assigning default values for new properties.

100% eager conversion is not often practical so you have to do lazy
conversion which to me means that you have a custom ResourceFactory that
reads in old XMI and converts it before it becomes visible as new
content to new code.

In CDO you may have the option to convert object by object, which might
make sense if you were using an Object repository, but with an
underlying Relational repository a partial upgrade may play havoc with
the indexes. To me this still needs a custom ResourceFactory.

Regards

Ed Willink

On 04/11/2014 16:05, Felix Dorner wrote:
> On 04/11/2014 15:59, ModelGeek Mising name wrote:
>> thanks for support.
>>
>> I have been looking foe different alternative to CDO... but CDO gives a
>> lot of features which are very important to us.
>> For us it is important that when we add new properties to classes then
>> objects saved using CDO remains retrievable... As you have said that it
>> would be problematic and i have done some test which indicate the same
>> phenomena... Is there any way we could solve this problem?
>
> Pragmatic (only?) approach is to export the model from CDO to say XMI,
> migrate it somehow and then re-import it into CDO..
>
>> thanks again!
>>
>> Cheers
>
Re: EMF Object and discrepancy tolerance [message #1461556 is a reply to message #1461506] Tue, 04 November 2014 17:43 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
Ed,

Comments below.

On 04/11/2014 5:29 PM, Ed Willink wrote:
> Hi
>
> I think you are making your problem harder by considering it as a CDO
> problem.
CDO is quite special. The Ecore model itself is committed and fixed...
>
> If you want to allow your metamodels to evolve you have two choices.
>
> a) eager conversion to upgrade everything immediately
For CDO this involves some kind of data base migration. Perhaps as
Felix suggests, export everything to XMI and apply some conversion
logic, then create a new data base with the new model, importing all the
data...
>
> b) lazy conversion to upgrade on demand
That's just not really an option for CDO.
>
> Either way you have to code a conversion algorithm, which if you are
> lucky may be as simple as assigning default values for new properties.
With CDO, there's a database migration problem. And if you keep a
history, what happens to that?
>
> 100% eager conversion is not often practical so you have to do lazy
> conversion which to me means that you have a custom ResourceFactory
> that reads in old XMI and converts it before it becomes visible as new
> content to new code.
Again, CDO is not so purely tailorable with specialized resource factories.
>
> In CDO you may have the option to convert object by object,
No.
> which might make sense if you were using an Object repository, but
> with an underlying Relational repository a partial upgrade may play
> havoc with the indexes.
Yes.
> To me this still needs a custom ResourceFactory.
It's just doesn't boil down to the same problem with CDO...
>
> Regards
>
> Ed Willink
>
> On 04/11/2014 16:05, Felix Dorner wrote:
>> On 04/11/2014 15:59, ModelGeek Mising name wrote:
>>> thanks for support.
>>>
>>> I have been looking foe different alternative to CDO... but CDO gives a
>>> lot of features which are very important to us.
>>> For us it is important that when we add new properties to classes then
>>> objects saved using CDO remains retrievable... As you have said
>>> that it
>>> would be problematic and i have done some test which indicate the same
>>> phenomena... Is there any way we could solve this problem?
>>
>> Pragmatic (only?) approach is to export the model from CDO to say XMI,
>> migrate it somehow and then re-import it into CDO..
>>
>>> thanks again!
>>>
>>> Cheers
>>
>
Previous Topic:Help me to fix reset list of command execution
Next Topic:[CDO] Stop/Close a running CDO server does not work
Goto Forum:
  


Current Time: Sat Dec 14 07:22:23 GMT 2019

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

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

Back to the top