About

Simple Feature Models DSL is a small project to create feature models textually and export them as images with GraphViz for auto-layout. I started the project when I was trying to edit feature diagrams in PowerPoint, resulting in time-consuming layout activities.

Intended audience

  • Users that often deal with feature models and their documentation, and that feel layout should not be part of their job
  • Developers that want to use the project as a study object to learn how to develop a textual DSL with the Xtext Language Development Framework

Features

  • Free and open source Eclipse plugin
  • Simple domain-specific language (DSL) for feature modeling
  • Supports or and xor feature groups
  • Supports mandatory and optional cardinalities for solitary features
  • Supports 'feature-as-concept' relation for hierarchical feature modeling
  • Exports dot files as an input for GraphViz
  • Exports svg and png files directly if GraphViz is installed
  • Svg export supports 'feature-as-concept' relations as links between svg files
  • Svg export supports feature documentation as mouse-over tooltips

Example Input

SFM Language Example

Example Output

SFM SVG Generate

You should know this, too

  • The project is realized with the Xtext Language Development Framework and GraphViz.
  • The project is provided as-is. I will sporadically update or bugfix the program as the need arises for my purposes. But if you miss a certain feature: Go grab the sources and implement them on your own!

Download

The complete Project can be downloaded from the Sourceforge project page via the project page's Files link. The project contains:

  • The software distribution as a set of Eclipse plugins
  • The complete source code
Note that this page serves as the documentation. For everything else, you can contact me or read the comments in the source code.

Requirements

The project is implemented in Java as an Eclipse plugin and has only modest system requirements. A client should meet at least the following requirements:

  • Operating System: Everything that runs Eclipse
  • Java Version: J2SE-1.5 or greater
  • Eclipse Xtext v1.0.1 (or greater?)

Installation

Follow these simple steps:

  1. Download the software distribution.
  2. Unzip the software distribution zip file. You get three jar files that represent Eclipse plugins: Simple Feature Models DSL Eclipse Plugins
    • 'featuremodel' represents the core DSL and contains the grammar definition.
    • 'featuremodel.generator' represents the generator to generate the dot, svg and png files.
    • 'featuremodel.ui' represents the IDE-specific stuff such as editor views and a project wizard.
  3. Put the jar files of the software distribution into the 'plugins' folder of your Eclipse installation. Eclipse Plugin Folder
  4. Restart your Eclipse if necessary.

Note: In order to generate not only dot files as an input for GraphViz, but also svg and png images directly, you have to install GraphViz and add it to your classpath.

Tutorial

Create new Project

Open Eclipse w/ Xtext and the SFM plugins installed. Go to 'New->Other'.Create new SFM Project

In the 'Select a wizard' dialog, go to 'Xtext->SimpleFeatureModel Project', then click 'Next'.'Select a wizard' Dialog

In the 'SimpleFeatureModel Project' dialog, insert a project name, then click 'Finish'.'SimpleFeatureModel Project' Dialog

Project Structure

In the new project, there are already two feature models as an example. They are located in the 'model' package.SFM Project Structure

One of the examples looks as follows. SFM Language Example

You also get a nice outline view. SFM Language Outline

Generate Feature Diagrams

Right-click on the file 'Generator.mwe2'. This is the generator workflow that generates the dot and the image files for your feature models. In the context menu, select 'RunAs->MWE2Workflow' to generate the images.SFM Generator Workflow

If you have GraphViz instalöled, your 'src-gen' folder should now look as follows. For each of your feature models, you should find a dot file and an svg and png image for further use.SFM Example Generates

Open the generated svg file 'dataflowfeatures.svg'. As you can see, it opens nicely in Firefox. Your short descriptions are rendered as tooltips when you hover the mouse over the respective features or concepts. But most important, the 'feature-as-concept' relationship between feature models is repersented as working links between svg feature diagrams. SFM SVG Generate

Language Model

Language Metamodel

SFM Language Metamodel

Xtext Grammar

SFM Language Grammar

Example

SFM Language Example

Generated Image from Example

Generated Image

Contact

The best way to contact me is to send me an e-mail: stefan ((at)) gudenkauf ((dot)) de