14
Leveraging Software Product Lines Engineering in the construction of Domain-Specific Languages David Méndez Acuña Benoît Combemale VaryMDE DiverSE Coffe – 23th April 2015

Tool demo composition of executable languages

Embed Size (px)

Citation preview

Page 1: Tool demo composition of executable languages

Leveraging Software Product Lines Engineering in the construction of

Domain-Specific Languages

David Méndez Acuña Benoît Combemale

VaryMDE

DiverSE Coffe – 23th April 2015

Page 2: Tool demo composition of executable languages

Problem statement

UML state machines diagrams

Rhapsody

Classical statecharts

States and simple transitions (triggers, conditions, etc.)

Example: A family of languages for Finite State Machines A   B  

event[condition]  

Academic example: Crane, M., Dingel, J., UML vs. classical vs. Rhapsody statecharts: not all models are created equal. Software & Systems Modeling. Vol. 6 No. 4. Springer-Verlag 2007.

Semantic and syntactic variation points in languages for FSM

Page 3: Tool demo composition of executable languages

Example: A family of languages for Finite State Machines

Family of Languages

Feature A

Feature B Feature B

F. D F. D F. D F. D F. D F. D

Language Product Line

Software Languages are Software too!

Software Engineering Techniques … Software Product Lines Engineering

Méndez-Acuña’s PhD

Jean-Marie Favre, Dragan Gasevic, Ralf Lmmel, and Ekaterina Pek. Empirical Language Analysis in Software Linguistics. In Software Language Engineering. Springer. 2011

Steffen Zschaler, Pablo Sánchez, Joo Santos, Mauricio Alférez, Awais Rashid, Lidia Fuentes, Ana Moreira, Joo Arajo, and Uir Kulesza. VML* A Family of Languages for Variability Management in Software

Product Lines. In Software Language Engineering. Springer. 2010.

Page 4: Tool demo composition of executable languages

Challenges

Language Units

Family of DSLs

Variability Models & Configuration

Feature A

Feature B Feature B

F. D F. D F. D F. D F. D F. D

Multi-dimensional & staged variability modeling

Configured DSL

Language Units Composition

Modular Languages Design

Page 5: Tool demo composition of executable languages

Let’s get fun! Tool DEMO

Page 6: Tool demo composition of executable languages

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

Button a

Display

Page 7: Tool demo composition of executable languages

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

while(alarm1.active){ println(‘(1) beep’) }

while(alarm1.active){ println(‘(2) beep’) }

doActivity

doActivity

Core FSM: State Machine, States, Transitions, Triggers

Imperative Language: Program, Loop, Conditions, …

Page 8: Tool demo composition of executable languages

The citizen watch

Core FSM: State Machine, States, Transitions, Triggers

Imperative Language: Program, Loop, Conditions, … Required

Interface

Provided Interface

aggregation

Page 9: Tool demo composition of executable languages

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

Core FSM: State Machine, States, Transitions, Triggers CompositeStates:

CompositeState, … +

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

a  

T2  

Page 10: Tool demo composition of executable languages

The citizen watch

Initial

displays

alarm 1

alarm 2

start  

T1  

a  

T2  

David Harel. 1987. Statecharts: A visual formalism for complex systems. Sci. Comput. Program. 8, 3 (June 1987), 231-274.

while(alarm1.active){ println(‘(1) beep’) }

while(alarm1.active){ println(‘(2) beep’) }

doActivity

doActivity

Core FSM: State Machine, States, Transitions, Triggers CompositeStates:

CompositeState, … +

Page 11: Tool demo composition of executable languages

The citizen watch

Core FSM: State Machine, States, Transitions, Triggers

Imperative Language: Program, Loop, Conditions, … Required

Interface

Provided Interface

CompositeStates: CompositeState, …

Extension Point

Extension

aggregation

extension

Page 12: Tool demo composition of executable languages

Melange

Some cool features coming…

From Variability Models to Software Languages Engineering in the Large

Page 13: Tool demo composition of executable languages

Some cool features coming…

Program

+exec() : void

Statement

+eval() : void

Condition

+eval() : void

Loop

+eval() : void

VarDecl

+eval() : void

StatementListContainer

+exec() : void

Statement

+eval() : void

Method

+exec() : void

statements

0 .. *

statements 0 .. *

Condition

+eval() : void

ForLoop

+eval() : void

LocalVariableStatement

+eval() : void

Statement

+eval() : void

Block

+eval() : void

IfStatement

+eval() : void

ForStatement

+eval() : void

VariableDeclaration

+eval() : void

statements

0 .. * Constraint

+eval(context : Map) : boolean

Provided Interface: Java Provided Interface: C#

Required Interface:

Finite State Machines Binding

Java <-> FiniteStateMachines Binding

C# <-> FiniteStateMachines

Structural heterogeneities

Page 14: Tool demo composition of executable languages

FOR YOUR ATTENTION, THANK YOU!

QUESTIONS, COMMENTS,

FEEDBACK?