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.
execute?
map
DSL Program (aka Model) map automated! GPL Program
M2T Model-to-Text Transformations Extensions to modularize complex expressions
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
Generated Editor Goto Definition Find References Cross-File References Model as EMF
Generated Editor
XtextOverview
DEMO Building a sample textual DSL and code generator for a simple domain using Eclipse TMF/openArchitectureWare
Another Tool…? OSLO
Another Tool…?
also do… IntelliJ IDEA Resharper
released in Q3 2009 licensed under Apache 2.0
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
Language Extension Example Old New Java Java + Extension ReadWriteLock l = … l.readLock().lock(); try { //code } finally { l.readLock().unlock(); } ReadWriteLock l = … lock (l) { //code }
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Structure Editor Typesystem Generator
Language Extension Example Result behaves like a native base language construct
Language Extension Example Result behaves like a native base language construct
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; } }
Example Languages UI Language
Example Languages HTML Templates
Example Languages Persistent Classes
Variability Configuration Customization MDD Intro MDD Tooling Model Variability Transformation Var. Summary & Wrapup
Two Levels problemspace vs. softwarespace Problem Space: Configuration Software Space: Customization
DEMO Introducing Variability into the Code Generator built before
Variability Configuration Customization MDD Intro MDD Tooling Model Variability Transformation Var. Summary & Wrapup
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/
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
Domain specific languages, together with code gener more
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. less
0 comments
Post a comment