A general question about derived features in EMF [message #1338630] |
Wed, 07 May 2014 09:51 |
Emre T Messages: 119 Registered: April 2013 |
Senior Member |
|
|
In EMF, one can define derived attributes or references for or between model elements, which are then computed from the actual state of the EMF model instances, based on the loaded resources etc. I find it very interesting to bind complex or fragmented models together. But in this case EMF lets the generated model code for such features simply empty and expects the user to implement the logic and mark the generated empty code signature then as "generated NOT".
Unfortunately, there are not a lot of materials regarding this scenario. I find the EMF-IncQuery a powerful tool in this matter. There are also an EMF Recipe for a Notifier for derived attributes and an example of how to use Feature Maps, which is from 2004. Also using OCL for derivation seems to be a possibility, though I am not so sure whether OCL acts as a setter for the values of the derived features directly, or only validates the value after the value is set by another mean?
So my general question would be, what the best practice is for implementing the getters for derived attributes or references? If my question should be vague, I can definitely narrow it to be precise.
Thanks a lot!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03476 seconds