Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » EMF Changeable problem
EMF Changeable problem [message #85568] Tue, 01 July 2008 13:28 Go to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Hello,

one more problem:
I tried to create an EMF-Model with ATL, that applies to an Ecore
metamodel of mine. On one attribute of the metamodel I set the property
changeable to false. My intention was to forbid the user of the
output-model to change some of the created/generated values.
Unfortunately ATL complains, that it cannot set this attribute ("message:
feature name is not changeable"). But there must be a way to initialize
the attribute. What sense does a read-only attribute make, when there is
no way to set the standard-value? Or can this only be used in combination
with a static default value in the metamodel and the modification has to
be controlled over the editor for the generated model-files?

Kind regards,
Max
Re: EMF Changeable problem [message #85584 is a reply to message #85568] Tue, 01 July 2008 14:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Max,

If you make something unchangeable you should expect never to be able to
change it. So generally it will be transient and likely will be
derived, i.e., its value is computed from the value of something else.
Perhaps you just want to suppress the setters from the API to make it
difficult but not impossible for the user to change the value.


Max Bureck wrote:
> Hello,
>
> one more problem:
> I tried to create an EMF-Model with ATL, that applies to an Ecore
> metamodel of mine. On one attribute of the metamodel I set the
> property changeable to false. My intention was to forbid the user of
> the output-model to change some of the created/generated values.
> Unfortunately ATL complains, that it cannot set this attribute
> ("message: feature name is not changeable"). But there must be a way
> to initialize the attribute. What sense does a read-only attribute
> make, when there is no way to set the standard-value? Or can this only
> be used in combination with a static default value in the metamodel
> and the modification has to be controlled over the editor for the
> generated model-files?
>
> Kind regards,
> Max
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF Changeable problem [message #85640 is a reply to message #85584] Wed, 02 July 2008 07:51 Go to previous message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Hi,

thanks for that idea. My problem is, that changing the .ecore file and
re-generating the model-code would overwrite the API-changes. So I'll
simply stick to the plan to make these attributes not changeable in the
editor for the model. This won't help if someone changes the model via the
API, but this is not planned at the moment.

Thanks,
Max

Ed Merks wrote:

> Max,

> If you make something unchangeable you should expect never to be able to
> change it. So generally it will be transient and likely will be
> derived, i.e., its value is computed from the value of something else.
> Perhaps you just want to suppress the setters from the API to make it
> difficult but not impossible for the user to change the value.
Previous Topic:How to work with circular references?
Next Topic:[ATL] uml2bpel problem
Goto Forum:
  


Current Time: Fri Apr 19 20:25:19 GMT 2024

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

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

Back to the top