Product lines of multi-level models in metaDepth
To improve current language reuse techniques, we propose combining multi-level modelling and product lines. This allows the definition of highly configurable language families that profit from both open variability (as given by instantiation) and closed variability (as given by configuration). We have extended MetaDepth for this purpose, along the lines of the following papers:
- Juan de Lara, Esther Guerra. Multi-level Model Product Lines. Open and closed variability for modelling language families. Proc. FASE 2020
- Juan de Lara, Esther Guerra. Language Family Engineering with Product Lines of Multi-level Models. 2021. (Under evaluation)
Requirements
In order to experiment with the tool, you'll need Java 8 (at least) installed in your computer.
Installation
- Download the following zip file.
- Decompress the zip file into a folder.
- Open a command line console, go to the folder, and type:
java -jar metaDepth.jar - Then, you should see the following in the console:
- This is metaDepth's console (the REPL), where you can type commands, load metaDepth (.mdepth) files, or execute file commands (.mdc)
- Please make sure you have the MOP environment variable is set to true. You can obtain the environment variables by the command set. To change the value of that variable, type: set MOP true
- Please refer to the documentation for further details on basic commands
// ) )
_ __ ___ __ ___ ___ // / / ___ ___ __ ___ / __
// ) ) ) ) //___) ) / / // ) ) // / / //___) ) // ) ) / / // ) )
// / / / / // / / // / / // / / // //___/ / / / // / /
// / / / / ((____ / / ((___( ( //____/ / ((____ // / / // / /
MetaDepth v0.3.MTL
http://metadepth.org
Top level command shell
Tue Mar 23 16:52:46 CET 2021
>
Execution
To create a multi-level model product line, you need to create a feature model, and then assign presence conditions to the multi-level model via annotations, as the next listing shows.
load "VariabilityAnnotations.annotations"
load "ProcessLang.features"
@Variability(model="ProcessLang")
Model ProcessModel@2 {
@Presence(condition="true")
Node TaskType {
@FPresence(condition="initial")
initial@1 : boolean = false;
duration : int;
@FPresence(condition="enactment")
rDuration : int;
@FPresence(condition="simple")
next : TaskType;
@FPresence(condition="actors")
perfBy : ActorKind;
}
@Presence(condition="actors")
Node ActorKind;
@Presence(condition="object")
Node GatewayType {
src : TaskType[*];
tar : TaskType[*];
}
}load "FeatureModel"
FeatureModel ProcessLang@2{
top ProcessLanguage : Gateways actors@1? Tasks;
alt Gateways : simple@0 object@0;
Tasks: initial@1? enactment@2?;
}config ProcessModel with { !actors, object }Once built, a feature model can be extended using the command add, as shown in the example below. Please note that such command should be emmited in the context of the model to be configured, in this case SoftwarePM (an instance of ProcessModel). The command adds an optional feature called details, with potency 1, under feature Tasks.
context SoftwarePM
add opt feat details@1 under Tasks context SoftwarePM
promote feat detailsExamples
Some examples of product lines for process modelling can be found in folder /deepPLs. Make sure your DIR environment variable points to that folder, by typing: set DIR "./deepPLs/" . All runnable scripts have extension .mdc. You can just run them with run "fileName.mdc" (where fileName is the name of the file):
- PM.mdc instantiates the product line for software process models, extends the model with an additional feature and some extensions, and promotes the extensions to the top level.
- PM_query_config.mdc shows how to configure the deep model PL, and obtain the current configuration.
- PM_config.mdc performs a condiguration step, an instantiation step, and another configuration.