Universal Variability Language (UVL)

Importing Submodels

Larger variability models may be hard to overview. To simplify viewing and editing such models, UVL allows specifying submodels that can then be referenced in a composing model.

Consider our sandwich model as example:


features
    Sandwich
        mandatory
            Bread
        optional
            Sauce
                alternative
                    Ketchup
                    Mustard
            Cheese
constraints
    Ketchup => Cheese

Here, it may make sense to decompose the Sauce into a separate UVL model:


features
    Type
        alternative
            Ketchup
            Mustard

Suppose we stored this submodel in a path ./submodels/Sauces.uvl

We can then use this submodel by using the imports keyword in a composed model. Further, we can reference the root feature of the imported model at any point the feature tree.


imports
    submodels.Sauces as Sauce

features
    Sandwich
        mandatory
            Bread
        optional
            Sauce.Type
constraints
    Sauce.Ketchup => Cheese