|
Re: Extend EAttributeImpl [message #1775612 is a reply to message #1775600] |
Thu, 02 November 2017 08:34 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Hauke Fuhrmann wrote on Thu, 02 November 2017 07:11Hi there,
I have a use case where attributes not only have a value but an additional status field with an enum and maybe even more properties (for example two values and the status determines which value is the actual one).
This to me begs the question: how is all this not simply a complex value?Quote:
Of course, my custom attribute would require to serialize all this information to XML.
Also suggesting that all this is just a value.Quote:
It's a little odd usecase, but I was interested if there is some extension mechanism in EMF to achieve that.
This use case somehow being distinct from simply using an EClass to describe all the state or using a hand written class wrapped as an EDataType to represent the state just isn't clear to me.Quote:
I.e. for classes I could add a different Implementation of EObjectImpl in the "Root Extends Class" field. However, this is only a single setting for the whole model and cannot be done per class. This part isn't clear either.Quote:
Still, for EAttributes there seems no option to change the implementation of the EAttribute, neither for the whole model nor for a single attribute.
Event the terminology is confusing me. You can annotate an EAttribute but extending it seems inappopriate because clearly anything you add to an extended EAttribute will have no impact on serialization of instances and generally will have no impact on the representation of instances, both dynamic and generated. So it's just not the right direction in which to go...Quote:
Is an EDataType suitable for that? Does it make sense to create custom Data Types that are similar to Attributes with my additional behaviour/structure? Seems quite effort prone/brittle.
This confuses me too. How can an EDataType be similar to an EAttribute? Of course whatever value you want to represent you must model either using an EClass or using something hand written wrapped in an EDataType, keeping in mind that data values should generally be immutable because you will not get notification about changes other than changes to the value has a whole.Quote:
Cheers,
Hauke
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03065 seconds