Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF] Change volatile and transient properties
[EMF] Change volatile and transient properties [message #1060651] Mon, 27 May 2013 13:31 Go to next message
Aleksandar Toshovski is currently offline Aleksandar ToshovskiFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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 #1060940 is a reply to message #1060760] Wed, 29 May 2013 09:06 Go to previous messageGo to next message
Aleksandar Toshovski is currently offline Aleksandar ToshovskiFriend
Messages: 78
Registered: December 2011
Member
Thank you Ed for your reply. Is there any documentation describing which changes of the metamodel will cause an error in the EMF Editor?
Re: Change volatile and transient properties [message #1060995 is a reply to message #1060940] Wed, 29 May 2013 13:19 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
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/
Previous Topic:define getter of derived volatile attribute
Next Topic:Can trigger a method call for an attribute change in an EMF model?
Goto Forum:
  


Current Time: Fri Mar 29 15:07:40 GMT 2024

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

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

Back to the top