Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » EMF Changeable problem
EMF Changeable problem [message #85568] Tue, 01 July 2008 09:28 Go to next message
Eclipse UserFriend
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 10:43 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: EMF Changeable problem [message #85640 is a reply to message #85584] Wed, 02 July 2008 03:51 Go to previous message
Eclipse UserFriend
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: Wed Jul 30 14:17:01 EDT 2025

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

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

Back to the top