[EMF] Reusable Annotations [message #1750445] |
Wed, 21 December 2016 07:27 |
|
I have a model instance which is a result of MoDisco discoverer execution and I would like to insert manually more information into this model (i.e. Using EMF Editor). However, original model obtained from MoDisco might change as part of a fresh MoDisco discoverer execution and information manually inserted will be lost. Therefore, I am looking for a solution which allows me to avoid losing this manually added information, some sort of "reusable annotations". So far, I have considered following options:
1. Use a separate file to store a model with these reusable annotations and have the original model elements referenced from this separate model. This would be similar with .genmodel used by EMF itself.
2. Add annotation directly to model and export reusable annotations before a fresh MoDisco discoverer execution. Merge back reusable annotations after MoDisco discoverer execution.
3. Use ChangeModel to record changes to model and apply these changes to freshly generated model.
Any idea which option would be the best fit, eventually a new option?
Thanks,
Ioan
|
|
|
|
|
Re: [EMF] Reusable Annotations [message #1750487 is a reply to message #1750471] |
Wed, 21 December 2016 15:47 |
|
Thanks Ed&Felix for your quick feedback. I am using KDM model instances (Knowledge Discovery Model from OMG ) which has Annotation and Tag class defined, but I guess your suggestions works as KDM and Annotations/Tags works similar with Ecore and EAnnotations. My target is to build a Software Production Line as a chain of transformations, the starting point being a set of EMF models obtained by MoDisco discoverers. In each phase, I want to inject extra information to address variability points ( mainly directives for transformations ) which will help transformations to incrementally get my model to final destination.
The initial plan is to use a simple mechanism to preserve these extra information but eventually I want to expand on this idea and create what I am calling now "reusable annotations":
A. store extra information (it can be Annotation or Tag) outside of main model, so when model is regenerated, extra information is not lost
B. merge back extra information after original model is regenerated (granted I MUST address dangling cross references)
C. add flexibility to reuse extra information for a specific EObject to a category of EObjects based on a Query instead of simple cross reference. I understand, this option is more complicated and it may end with an Aspect Oriented Modelling approach. In this case, href is basically replaced by a query and weave the two models using these queries to find model elements to apply Annotations/Tags.
The reason behind #C: if I add some Annotations/Tags to an element of type Service, I want to reuse the same set of Annotations/Tags for all Services based on specific criteria ( i.e. name of service ends with "DAO" for DataAccessObject pattern or Services which implements a certain Interface).
That's why I am inclined at the moment to go with option #2, export the extra information and later on expand this approach with C.
Regards,
Ioan
|
|
|
Powered by
FUDForum. Page generated in 0.02924 seconds