Skip to main content



      Home
Home » Modeling » UML2 » UML2EcoreConverter, default values and EAttribute.unsettable
UML2EcoreConverter, default values and EAttribute.unsettable [message #878633] Tue, 29 May 2012 12:13 Go to next message
Eclipse UserFriend
Hi,


We have various profiles containing (mostly string typed) properties with
default values and would like to set the applications' values to null
explicitly, which works fine on the DynamicEObject instances, but breaks
between saving and loading.

In Ecore, handling of null values for EAttributes depends on the attribute's
default value and its 'unsettable' flag.

If I set an attribute value to null and that attribute has a default value,
saving and reloading will change the attribute's value to the default value
(since null is interpreted as not being changed from the default value
during save/load). In Ecore, this behavior can be controlled through the
'unsettable' flag of the attribute. Setting that to true will interpret null
as literally null.

Since no such flag exists on the UML2 Property, the UML2EcoreConverter does
not handle this, leaving all resulting EAttributes as unsettable=false,
causing the problems we see.

Would it be reasonable to introduce an option to the converter to change the
'unsettable' value
- either to simply always be true
- or even better, to be true for UML2 Properties with a lower bound of 0 ?

Best regards,
Carsten
Re: UML2EcoreConverter, default values and EAttribute.unsettable [message #878641 is a reply to message #878633] Tue, 29 May 2012 12:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi

If you apply the Ecore Profile and the EAttribute/EReference stereotype
you get the 'missing' facilities.

Regards

Ed Willink


On 29/05/2012 17:13, Carsten Reckord wrote:
> Hi,
>
>
> We have various profiles containing (mostly string typed) properties with
> default values and would like to set the applications' values to null
> explicitly, which works fine on the DynamicEObject instances, but breaks
> between saving and loading.
>
> In Ecore, handling of null values for EAttributes depends on the attribute's
> default value and its 'unsettable' flag.
>
> If I set an attribute value to null and that attribute has a default value,
> saving and reloading will change the attribute's value to the default value
> (since null is interpreted as not being changed from the default value
> during save/load). In Ecore, this behavior can be controlled through the
> 'unsettable' flag of the attribute. Setting that to true will interpret null
> as literally null.
>
> Since no such flag exists on the UML2 Property, the UML2EcoreConverter does
> not handle this, leaving all resulting EAttributes as unsettable=false,
> causing the problems we see.
>
> Would it be reasonable to introduce an option to the converter to change the
> 'unsettable' value
> - either to simply always be true
> - or even better, to be true for UML2 Properties with a lower bound of 0 ?
>
> Best regards,
> Carsten
Re: UML2EcoreConverter, default values and EAttribute.unsettable [message #878650 is a reply to message #878641] Tue, 29 May 2012 12:42 Go to previous message
Eclipse UserFriend
Hi Ed,

oh sorry, my simple usage search of setUnsettable didn't turn that up...

Best regards,
Carsten

On 29.05.2012 18:25, Ed Willink wrote:
> Hi
>
> If you apply the Ecore Profile and the EAttribute/EReference stereotype
> you get the 'missing' facilities.
>
> Regards
>
> Ed Willink
>
>
> On 29/05/2012 17:13, Carsten Reckord wrote:
>> Hi,
>>
>>
>> We have various profiles containing (mostly string typed) properties with
>> default values and would like to set the applications' values to null
>> explicitly, which works fine on the DynamicEObject instances, but breaks
>> between saving and loading.
>>
>> In Ecore, handling of null values for EAttributes depends on the attribute's
>> default value and its 'unsettable' flag.
>>
>> If I set an attribute value to null and that attribute has a default value,
>> saving and reloading will change the attribute's value to the default value
>> (since null is interpreted as not being changed from the default value
>> during save/load). In Ecore, this behavior can be controlled through the
>> 'unsettable' flag of the attribute. Setting that to true will interpret null
>> as literally null.
>>
>> Since no such flag exists on the UML2 Property, the UML2EcoreConverter does
>> not handle this, leaving all resulting EAttributes as unsettable=false,
>> causing the problems we see.
>>
>> Would it be reasonable to introduce an option to the converter to change the
>> 'unsettable' value
>> - either to simply always be true
>> - or even better, to be true for UML2 Properties with a lower bound of 0 ?
>>
>> Best regards,
>> Carsten
>
Previous Topic:UML Metamodel question
Next Topic: .UML to .XML
Goto Forum:
  


Current Time: Wed Jul 23 16:25:09 EDT 2025

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

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

Back to the top