Skip to content

The Generated Project Model DSL

Niklas Rentz edited this page Jan 21, 2026 · 1 revision

The Generated Project Model DSL

If you want to write your project model generator in a language outside of Java, want to manually design the goal architecture of a new project, or want to compare such a manual design to the actual architecture, you can also write your project model in a DSL format.

Using the OSGi architecture metamodel defined in this wiki page, an example textual project model leaning on this example project could be defined like this:

serviceComponent TranslatorClient {
    required TranslatorService
}
serviceInterface TranslatorService {
    providedBy German2KlingonTranslator
    providedBy German2EnglishTranslator
}
serviceComponent German2KlingonTranslator {
    required LanguageDatabaseProvider
}
serviceComponent German2EnglishTranslator {
    required LanguageDatabaseProvider
}
serviceInterface LanguageDatabaseProvider {
    providedBy FileBasedLanguageDatabaseProvider
}
serviceComponent FileBasedLanguageDatabaseProvider
feature English {
    bundles: [ 
        German_English
    ]
}
bundle German_English {
    serviceComponents: [
        German2EnglishTranslator
    ]
}
// ...

Every artifact that was modeled in the corresponding A2M can be instantiated here with the starting keyword, for example serviceComponent, bundle, etc. The containments are to be listed in the body of each artifact instance, for example the bundles contained have to be listed in a comma-separated list in the bundles list of each feature, or in the serviceComponents list of each bundle. Connections also have to be listed, each with their own keyword corresponding to the connection name, for example the required and providedBy fields in the service artifacts. Every artifact instance needs an ID, which will be used in the visualization as its name and needs to be used for cross-referencing the connected and contained artifact instances.

Every instance can also be defined as an external element by writing the external keyword in front of any artifact, which will be colored in a less saturated color and can be filtered in the view's options.

Clone this wiki locally