5.3.  Feature Models

Feature Models are used to express commonalities and variabilities efficiently. A Feature Model captures features and their relations . A feature is a property of the problem domain that is relevant with respect to commonalities of, and variation between, problems from this domain. The term relevant indicates that there is a stakeholder who is interested in an explicit representation of the given feature (property). What is relevant thus depends on the stakeholders. Different stakeholders may describe the same problem domain using different features.

Feature relations can be used to define valid selections of combinations of features for a domain. The main representation of these relations is a feature tree . In this tree the nodes are features and the connections between features indicate whether they are optional , alternative or mandatory . Table 9.4, “Element variation types and its icons” gives an explanation on these terms and shows how they are represented in feature diagrams.

Additional constraints can be expressed as restrictions, element relations, and/or model constraints. Possible restrictions could allow the inclusion of a feature only if two of three other features are selected as well, or disallow the inclusion of a feature if one of a specific set of features is selected.

Figure 5.4, “Basic structure of Feature Models” shows the principle structure of a pure::variants Feature Model as UML class diagram. A problem domain (ProblemDomainModel) consists of any number of Feature Models (FeatureModel). A Feature Model has at least one feature.

Figure 5.4. Basic structure of Feature Models

Basic structure of Feature Models

Some features of a domain cannot be easily or efficiently expressed by requiring a fixed description of the feature and allowing only inclusion or exclusion of the feature. Although for many features this is perfectly suitable. Feature attributes (i.e. element attributes in Feature Models) provide a way of associating arbitrary information with a feature. This significantly increases the expressive power of Feature Models.

However, it should be noted that this expressive power could come at a price in some cases. The main drawback is that for checking feature attribute values, the simple requires , conflicts , recommends and discouraged statements are insufficient. If value checks are necessary, for example to determine whether a value within a given range conflicts with another feature, pvSCL level restrictions will be required.