Multi-level product lines

Explore variability across levels.

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:

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:
    metaDepth / code
      java -jar metaDepth.jar
      
  • Then, you should see the following in the console:
  • Console output
                                                                                             
                                               //    ) )                                 
          _   __      ___    __  ___  ___     //    / /  ___      ___    __  ___ / __    
        // ) )  ) ) //___) )  / /   //   ) ) //    / / //___) ) //   ) )  / /   //   ) ) 
       // / /  / / //        / /   //   / / //    / / //       //___/ /  / /   //   / /  
      // / /  / / ((____    / /   ((___( ( //____/ / ((____   //        / /   //   / /   
    
    MetaDepth v0.3.MTL
    http://metadepth.org
      Top level command shell
      Tue Mar 23 16:52:46 CET 2021
    > 
      
  • 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

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.

metaDepth / code
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[*];
  }
}
The following listing specifies how the define a feature model. Please note the the model uses a specifically designed concrete syntax, and not MetaDepth's default one.
metaDepth / code
load "FeatureModel"

FeatureModel ProcessLang@2{
    top ProcessLanguage : Gateways actors@1? Tasks;
    alt Gateways : simple@0 object@0;
    Tasks: initial@1? enactment@2?;
 }
A deep model product line can be instantiated, or configured. For the former, just use the normal MetaDepth's syntax, and it will automatically add the presence condition annotations for you. For configuration, use the configure commands, using the syntax of the example below.
metaDepth / code
config ProcessModel with { !actors, object }
Where the ! symbol before a feature name indicates that the feature is to be deselected. Please note that by setting object to true, simple is set to false, since they are in an alternative branch.

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.
metaDepth / code
context SoftwarePM
add opt feat details@1 under Tasks 
Finally, the promote command can create a type for the extensions having the newly introduced features in their PC. For example, the following listing shows how to create a type for all elements whose PC contains feature details.
metaDepth / code
context SoftwarePM
promote feat details

Examples

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.
Please make sure that you exit or clean MetaDepths's virtual machine after each run.