Domain specific languages, together with code generation or interpreters (a.k.a. model-driven development), are becoming more and more important. Since there is a certain overhead involved in building languages and processors, this approach is especially useful in environments where a spe-cific set of languages and generators can be reused many times. Product lines are such an environment. Consequently, the use of domain specific languages (DSLs) for Software Product Line Engi-neering (SPLE) is becoming more relevant. However, exploiting DSLs in the context of product lines involves more than just defining and using languages. This tutorial explains the differences as well as commonalities between model-driven development (MDD) and SPLE and shows how the two approaches can be combined. In this tutorial we will first recap/introduce feature modeling and model-driven development. We then build a simple textual DSL and a code generator based on Eclipse openArchitectureWare (oAW). Based on this language we’ll discuss the kinds of variability expressible via DSLs versus those expressible via feature modeling, leading to a discussion about ways to combine the two. In the next demo slot we’ll do just that: we’ll annotate a model with feature dependencies. When generating code, the elements whose features are not selected will be removed, and hence no code will be generated. Finally we’ll discuss and demo the integration feature dependencies into code generators to con-figure the kind of code generated from the model.
40. DSL A DSL is a focussed, processablelanguage for describing a specific concern when building a system in a specific domain. The abstractions and notations used are natural/suitablefor the stakeholders who specify that particular concern.
66. openArchitectureWare www.openarchitectureware.org One Stop Toolkit for DSLs + X Version 5.0 is current Lively ecosystem of tools and extensions Proven track record in various domains & project contexts Stable, productive and helpful developer, support and user communities Integration with Eclipse: Part of Eclipse, Working Group Uses EMF as a basis Graphical editors based on GMF All editors and tooling based on Eclipse
86. Build new standalone DSLs Build DSLs that reuse parts of other languages Java++ (MPS comes with BaseLanguage) extend base language build DSLs that reuse parts of BaseLanguage
87. Language Extension Example Old New Java Java + Extension ReadWriteLock l = … l.readLock().lock(); try { //code } finally { l.readLock().unlock(); } ReadWriteLock l = … lock (l) { //code }
98. Language Extension Example Translated to regular Java code based on the generator package jaxdemo.sandbox.sandbox; import java.util.concurrent.locks.Lock; public class DemoClass { private Lock lock; public DemoClass() { try { this.getLock().lock(); SharedResouce.instance().doSomething(); } finally { this.getLock().unlock(); } } private Lock getLock() { return this.lock; } }
128. DSLs can be used to effectively describe customization variab. Transformation and Generation can be used to map PS to SS Configuration and Customization can be sensibly combined Various Tools are available, http://eclipse.org/modeling http://dslvariantmanagement.googlecode.com/
129. Domain Specific Languages Using Variability Configuration Customization MDD Intro MDD Tooling Model Variability Transformation Var. Summary & Wrapup for Product Line Engineering THE END. Thankyou. Questions? MarkusVoelter Independent/Itemis www.voelter.devoelter@acm.org