[EMF] Change volatile and transient properties [message #1060651] |
Mon, 27 May 2013 13:31 |
Aleksandar Toshovski Messages: 78 Registered: December 2011 |
Member |
|
|
Hello,
When I store some instances of an ECore model and then change violate value, would I have an error when I try to read the file and what kind of exception will occur?
And the same question about transient. If something is transient=true and then is changed to false. If i have instancies from the old ECore model, should I expect some kind of errors? And when transient=false and gets changed to transient=true. Would the stored values be ignored, or I'll recieve an error?
Regards,
Aleksandar
[Updated on: Mon, 27 May 2013 13:32] Report message to a moderator
|
|
|
Re: Change volatile and transient properties [message #1060760 is a reply to message #1060651] |
Tue, 28 May 2013 11:44 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Aleksandar,
Comments below.
On 27/05/2013 3:31 PM, Aleksandar Toshovski wrote:
> Hello,
> When I store some instances of an ECore model and then change violate
> value, would I have an error when I try to read the file and what kind
> of exception will occur?
That setting only affects the generated code, bug given that no field
will be generated and only stubs that throw exceptions for the accessors
are generated, so that won't work without some hand written code.
>
> And the same question about transient. If something is transient=true
> and then is changed to false. If i have instancies from the old ECore
> model, should I expect some kind of errors?
Transient things in the serialization won't generally cause exceptions
in deserialization (except possibly in cases of bidirectional
references; I'm not sure).
> And when transient=false and gets changed to transient=true. Would the
> stored values be ignored, or I'll recieve an error?
They'll generally just be read into the model, but won't be written back
out again.
>
> Regards,
> Aleksandar
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: Change volatile and transient properties [message #1060995 is a reply to message #1060940] |
Wed, 29 May 2013 13:19 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
No. Generally if you make changes that are binary compatible in the
Java API sense, you'll not have problems loading.
Note there's also an option,
org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE,
which can be used to support forward compatibility, i.e., an older
version of the tool can read newer serializations and will record
elements and attributes that are unrecognized in such a fashion that
they can be serialized back out again upon save.
On 29/05/2013 11:06 AM, Aleksandar Toshovski wrote:
> Thank you Ed for your reply. Is there any documentation describing
> which changes of the metamodel will cause an error in the EMF Editor?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02704 seconds