Skip to content

Commit bbff16c

Browse files
committed
Added subpage for import mechanism
1 parent 287dfa0 commit bbff16c

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

language/Submodels.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
### Importing Submodels
2+
3+
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.
4+
5+
Consider our sandwich model as example:
6+
7+
<code>
8+
<b>features</b>
9+
Sandwich
10+
<b>mandatory</b>
11+
Bread
12+
<b>optional</b>
13+
Sauce
14+
<b>alternative</b>
15+
Ketchup
16+
Mustard
17+
Cheese
18+
<b>constraints</b>
19+
Ketchup => Cheese
20+
</code>
21+
22+
Here, it may make sense to decompose the Sauce into a separate UVL model:
23+
24+
<code>
25+
<b>features</b>
26+
Type
27+
<b>alternative</b>
28+
Ketchup
29+
Mustard
30+
</code>
31+
32+
Suppose we stored this submodel in a path ./submodels/Sauces.uvl
33+
34+
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.
35+
36+
<code>
37+
<b>imports</b>
38+
submodels.Sauces as Sauce
39+
40+
<b>features</b>
41+
Sandwich
42+
<b>mandatory</b>
43+
Bread
44+
<b>optional</b>
45+
Sauce.Type
46+
<b>constraints</b>
47+
Sauce.Ketchup => Cheese
48+
</code>

0 commit comments

Comments
 (0)