Metamodel

The metamodel is represented as a feature model as shown on the right side of the figure below. It contains three diagrams, one for each feature model element: Feature, FeatureGroup and Reference. In the example below, feature Catalog selected in the model is an instance of the meta-feature Feature. Properties view shows the configuration of the meta-feature Feature. The properties of model elements can be extended by extending the meta-feature, such as Priority extension.

Properties view on the right shows the configuration of the meta-meta-feature Feature from the meta-metamodel. The meta-metamodel is hardcoded and cannot be extended. Note, that the metamodel is not a complete one - it does not contain structural dependencies between model elements such as 'a feature group can contain features and references, but not other feature groups'.

The implementation of the plug-in is based on Eclipse Modeling Framework (EMF). The next figure shows a complete metamodel (fmp.ecore) as defined in Ecore.
Feature models are serialized according the this metamodel using standard EMF serializer. The root of the EMF resource is Project and contains model, metamodel and meta-metamodel. Every element of the feature model is a Node and contains other nodes as children. The feature model and all of its configurations are represented using the same metamodel. The origin-confs association links nodes from the model (i.e., origins) to nodes from the configuration (i.e., confs).

Features and references with max > 1 can be cloned. The prototype-clones association relates the original feature (i.e., the prototype) with its clones. Additionally, the clonables can have a configuration state which can be one of five states defined in ConfigState enumeration. The default state is UNDECIDED.
The feature-references association allows the reference to point at a feature and navigate from the feature to all references pointing at it. A feature contains a value represented by TypedValue. The fourth value type FEATURE is what we call a reference attribute, a mechanism allowing to select a feature from the configuration as a value of the attribute. A feature can also contain a Constraint in which case, the feature is the context of the constraint (i.e., the constraint may only refer to subfeatures of the context feature).

The metamodel allows configuring a subtree of any feature in the feature model in which case the feature is referred to as a root feature. A root feature contains its configurations, that is copies of its subtree, where elements are related using the origin-confs association. The configurations seen in the Properties view are contained by meta-elements (i.e., the properties of feature Catalog are the configuration of meta-feature Feature and are also contained by Feature). The root of nodes's properties is related with the node using the properties-describedNode association.

The infinite recursion caused by metacircularity is broken in the meta-metamodel nodes, which do not have properties, but use normal class attributes such as Feature.name, Node.min, Reference.feature.

The fmp.system.MetaModel class is used for the creation of initial model, metamodel and meta-metamodel. Function public static Project makeProject() is used by new model wizard to create the contents of an empty feature model.