Maintenance of customer's model
Does anybody has an approach or strategy on how one should maintain customer's models written in DSL in case of development of this DSL? I have seen project migration dialogs in MPS when opening sample models (possibly written in older versions of languages?). What is happening during this migration?
Is there used a generator that reduces models written in old version language to models written in new version language?
How reliable is to store customer's models in MPS for them to be maintained properly?
Is there used a generator that reduces models written in old version language to models written in new version language?
How reliable is to store customer's models in MPS for them to be maintained properly?
Please sign in to leave a comment.
"Script Aspects" are what you are looking for. On a language, just right-click to open the context menu, choose New/Scripts Aspect. There you can create "Language Migration Scripts"
You may have a look at https://github.com/jensnerche/mps-options. There I have a short demo how to handle language evolution regarding to customer models. I factored it out of a real life project where it worked fine. The demo (a tiny feature model language) consists some other stuff like custom menus, but let's focus on the tiny demo language called "instance". In the sandbox is a solution called "Jens" which uses this language to configure a car based on the "Car" model in the same sandbox. The ProductInstance concept has a Customer concept as child, which only has the name as property. The first iteration of the language had the customer as "exactly one" cardinality. Now one could think of removing the Customer concept and put the name as only attribute directly into the ProductInstance (or the other way around, the reversed script is also included in the demo). First thing to do is to make the customer optional, so change the cardinality to 0..1 and to add the name as an attribute to ProductInstance (already done in the demo, ProductInstance implements INamedConcept). Then create a Language Migration Script, I named it IncludeCustomerNameIntoProductInstance. It's really short, as you can see, and self explaining. It appears in the Tools/Scripts/Enhancements menu. You can compare the AST before and after the run. I think you get the idea what is happening through the migration.
Now you have the legacy customer in your language, but you have to keep it until the next iteration of your language, because otherwise the migration script could not work.
To the other question of how to store customer's models - normally we at Kontext E store the models in MPS, but in some cases also as external (generated) text for some project internal reason. In the latter case we had to write an importer to read the text and re-create the models. Both works well, for one upcoming project we think about storing the data in a graph database because of the domain nature and interacting with other tools. I think it really depends on your project settings. MPS is able to use a VCS, so a model can be as save as other source code.
So have fun with metaprogramming! ;)
Jens
If someone would like take a look at it and possibly to implement and contribute to MPS, I could share my vision of a new refactoring framework. It's quite simple and just needs some time to implement, everything is core - independent except model versioning.
Did it help?
The only thing you should know is SNode.getId(), SModel.getId() methods and you should understand how MPS node references work.
In 3.0, all these things will be stated as OpenAPI.
help folder really doesn't exist.
So, after commenting out lines related to help folder, I'm finally got Ivy build file executed successfully.
Vaclav, thank you for instructions! Currently, I have MPS project of MPS opened right in front of me.
Mihail, please suggest me, where should I dig and what are your ideas on topic?