Yakindu Statechart - Domain specific statecharts

32
Yakindu SCT Domain-Specific Statecharts Alexander Nyßen, Axel Terfloth itemis AG Donnerstag, 29. März 12

description

YAKINDU is a modular toolkit for model-based development. The YAKINDU Statechart Tools' (SCT) formalism is similar to state machines as defined by David Harel, but comes • self-contained with a well defined interface • with a cycle-based execution semantics Find our more in this presentation!

Transcript of Yakindu Statechart - Domain specific statecharts

Page 1: Yakindu Statechart - Domain specific statecharts

Yakindu SCTDomain-Specific Statecharts

Alexander Nyßen, Axel Terflothitemis AG

Donnerstag, 29. März 12

Page 2: Yakindu Statechart - Domain specific statecharts

YAKINDU is a modular toolkit

for model-based development (of embedded systems)

Donnerstag, 29. März 12

Page 3: Yakindu Statechart - Domain specific statecharts

YAKINDU Modules

• independent and self-contained

• not bound to a specific methodology

• usable on their own

• open & extendable

• composable to (domain-specific) language workbenches

➡ Reuse of

• modeling language

• toolsEclipse Platform

Da

mo

s (B

lock

s)

SC

T (

Sta

tech

art

s)

Co

Mo

CR

eM

a

Donnerstag, 29. März 12

Page 4: Yakindu Statechart - Domain specific statecharts

YAKINDU Statechart Tools (SCT)Editing

Valid

atio

n Sim

ulation

Code Generation

Donnerstag, 29. März 12

Page 5: Yakindu Statechart - Domain specific statecharts

YAKINDU Statechart• Formalism similar to state machines as defined by

David Harel, but:

• self-contained with a well defined interface

• with a cycle-based execution semantics

• allows processing concurrent events

• event-driven behavior can be defined on top

• time control is delegated to the environment

Donnerstag, 29. März 12

Page 6: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Editing

Donnerstag, 29. März 12

Page 7: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Editing

Editor

SGraph

SText

Integrated Graphical & Textual

Modeling

Donnerstag, 29. März 12

Page 8: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Simulation

Donnerstag, 29. März 12

Page 9: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Simulation

Editor

SGraph

SText

Easy adoptablesimulation

SExec Simulator

Donnerstag, 29. März 12

Page 10: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Code Generation• Yakindu comprises code generators for Java, C, C++

• All generators can be „customized“ by a generator model

• Custom generators based on Xpand & Xtend2/Java can be easily integrated

Donnerstag, 29. März 12

Page 11: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Code Generation• Yakindu comprises code generators for Java, C, C++

• All generators can be „customized“ by a generator model

• Custom generators based on Xpand & Xtend2/Java can be easily integrated

Editor

SGraph

SText

Flexible Code Generation

SExec Simulator

Code-GeneratorsSGen

Donnerstag, 29. März 12

Page 12: Yakindu Statechart - Domain specific statecharts

DEMO

Donnerstag, 29. März 12

Page 13: Yakindu Statechart - Domain specific statecharts

Yakindu SCT - Extensibility• Recap: different models are used around the Statechart formalism

• SGraph (EMF): specification of graphical structures

• SText (Xtext): textual specification of declarations & expressions

• SExec (EMF): sequentialized statechart execution

• SGen (Xtext): code generator parameterization

Donnerstag, 29. März 12

Page 14: Yakindu Statechart - Domain specific statecharts

Built-In Extensibility• Restriction of structural concepts (SGraph)

• Customization of declarations & expressions (SText)

• Adoption of the execution semantics (SExec)

• Adoption of existing or integration of custom code generators

• Integration of custom type system, augmentation by application types

• Integration of additional validation constraints

Donnerstag, 29. März 12

Page 15: Yakindu Statechart - Domain specific statecharts

The Statechart Application Gap

Donnerstag, 29. März 12

Page 16: Yakindu Statechart - Domain specific statecharts

The Statechart Application Gap

State-based modelingis useful

in many domains

Donnerstag, 29. März 12

Page 17: Yakindu Statechart - Domain specific statecharts

The Statechart Application Gap

State-based modelingis useful

in many domains

Typically, statecharts are independentof any domain

Donnerstag, 29. März 12

Page 18: Yakindu Statechart - Domain specific statecharts

The Statechart Application Gap

• How can statecharts be adopted to a specific domain?

• How can tools support this adoption?

State-based modelingis useful

in many domains

Typically, statecharts are independentof any domain

Donnerstag, 29. März 12

Page 19: Yakindu Statechart - Domain specific statecharts

Example: Domain Concepts - HMI

Donnerstag, 29. März 12

Page 20: Yakindu Statechart - Domain specific statecharts

Domain Specific Statecharts• Improving expressiveness and semantic integration by

adopting domain concepts:

• Refer to domain concepts within declarations (events, variables) and expressions (feature-calls)

• Concepts from HMI domain: widget (button, label, etc.), scene, popup, animation, button-click, intro, outro,...

Donnerstag, 29. März 12

Page 21: Yakindu Statechart - Domain specific statecharts

Integration of HMI Concepts

Donnerstag, 29. März 12

Page 22: Yakindu Statechart - Domain specific statecharts

DEMO

Donnerstag, 29. März 12

Page 23: Yakindu Statechart - Domain specific statecharts

Domain-Specific Statechart Approach

Donnerstag, 29. März 12

Page 24: Yakindu Statechart - Domain specific statecharts

Generic

Domain-Specific Statechart Approach

Structural Concepts(SGraph)

Donnerstag, 29. März 12

Page 25: Yakindu Statechart - Domain specific statecharts

Generic

Domain-Specific Statechart Approach

Structural Concepts(SGraph)

grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals

/* ---- root rules ----These root rules are not relevant for the grammar integration

into a single grammar. */Root: (roots+=DefRoot)*;DefRoot: StatechartRoot | StateRoot | TransitionRoot;Scope returns sct::Scope: (SimpleScope | StatechartScope); // a SimpleScope is used for states and regionsSimpleScope returns sct::Scope: {SimpleScope} (declarations+=Declaration)*; // defines the poosible scopes for statechartsStatechartScope returns sct::Scope: InterfaceScope | InternalScope;InterfaceScope returns sct::Scope:

Declarations & Expressions

(SText)extends

Donnerstag, 29. März 12

Page 26: Yakindu Statechart - Domain specific statecharts

Generic

Domain-SpecificDomain-Specific Statechart Approach

HMI Meta Model

Structural Concepts(SGraph)

grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals

/* ---- root rules ----These root rules are not relevant for the grammar integration

into a single grammar. */Root: (roots+=DefRoot)*;DefRoot: StatechartRoot | StateRoot | TransitionRoot;Scope returns sct::Scope: (SimpleScope | StatechartScope); // a SimpleScope is used for states and regionsSimpleScope returns sct::Scope: {SimpleScope} (declarations+=Declaration)*; // defines the poosible scopes for statechartsStatechartScope returns sct::Scope: InterfaceScope | InternalScope;InterfaceScope returns sct::Scope:

Declarations & Expressions

(SText)extends

Donnerstag, 29. März 12

Page 27: Yakindu Statechart - Domain specific statecharts

Generic

Domain-SpecificDomain-Specific Statechart Approach

spec

ializ

atio

n

HMI Meta Model

Structural Concepts(SGraph)

grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals

/* ---- root rules ----These root rules are not relevant for the grammar integration

into a single grammar. */Root: (roots+=DefRoot)*;DefRoot: StatechartRoot | StateRoot | TransitionRoot;Scope returns sct::Scope: (SimpleScope | StatechartScope); // a SimpleScope is used for states and regionsSimpleScope returns sct::Scope: {SimpleScope} (declarations+=Declaration)*; // defines the poosible scopes for statechartsStatechartScope returns sct::Scope: InterfaceScope | InternalScope;InterfaceScope returns sct::Scope:

Declarations & Expressions

(SText)extends

Donnerstag, 29. März 12

Page 28: Yakindu Statechart - Domain specific statecharts

Generic

Domain-SpecificDomain-Specific Statechart Approach

spec

ializ

atio

n

HMI Meta Model

Structural Concepts(SGraph)

grammar com.yakindu.hmi.sctmodel.HMIText with org.yakindu.sct.model.stext.SText

/* ---- root rules ----These root rules are not relevant for the into a single grammar. */Root: (roots+=DefRoot)*;

Declaration returns sct::Declaration: EventDefinition | VariableDefinition | Clock | Operation

| LocalReaction | Entrypoint | Exitpoint | HMIDeclaration;

HMIDeclaration: HmiScene | HmiPopup | HmiAnimation | HmiTransition;HmiScene: 'scene' scene=[contract::Scene|QID];HmiPopup: 'popup' popup=[contract::Popup|QID];HmiAnimation: 'animation' animation=[contract::Animation|QID];

HMI Declarations

grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals

/* ---- root rules ----These root rules are not relevant for the grammar integration

into a single grammar. */Root: (roots+=DefRoot)*;DefRoot: StatechartRoot | StateRoot | TransitionRoot;Scope returns sct::Scope: (SimpleScope | StatechartScope); // a SimpleScope is used for states and regionsSimpleScope returns sct::Scope: {SimpleScope} (declarations+=Declaration)*; // defines the poosible scopes for statechartsStatechartScope returns sct::Scope: InterfaceScope | InternalScope;InterfaceScope returns sct::Scope:

Declarations & Expressions

(SText)extends

Donnerstag, 29. März 12

Page 29: Yakindu Statechart - Domain specific statecharts

Generic

Domain-SpecificDomain-Specific Statechart Approach

spec

ializ

atio

n

HMI Meta Model

Structural Concepts(SGraph)

grammar com.yakindu.hmi.sctmodel.HMIText with org.yakindu.sct.model.stext.SText

/* ---- root rules ----These root rules are not relevant for the into a single grammar. */Root: (roots+=DefRoot)*;

Declaration returns sct::Declaration: EventDefinition | VariableDefinition | Clock | Operation

| LocalReaction | Entrypoint | Exitpoint | HMIDeclaration;

HMIDeclaration: HmiScene | HmiPopup | HmiAnimation | HmiTransition;HmiScene: 'scene' scene=[contract::Scene|QID];HmiPopup: 'popup' popup=[contract::Popup|QID];HmiAnimation: 'animation' animation=[contract::Animation|QID];

HMI Declarations

grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals

/* ---- root rules ----These root rules are not relevant for the grammar integration

into a single grammar. */Root: (roots+=DefRoot)*;DefRoot: StatechartRoot | StateRoot | TransitionRoot;Scope returns sct::Scope: (SimpleScope | StatechartScope); // a SimpleScope is used for states and regionsSimpleScope returns sct::Scope: {SimpleScope} (declarations+=Declaration)*; // defines the poosible scopes for statechartsStatechartScope returns sct::Scope: InterfaceScope | InternalScope;InterfaceScope returns sct::Scope:

Declarations & Expressions

(SText)

references

extends

exte

nds

Donnerstag, 29. März 12

Page 30: Yakindu Statechart - Domain specific statecharts

Generic

Domain-SpecificDomain-Specific Statechart Approach

spec

ializ

atio

n

HMI Meta Model

Structural Concepts(SGraph)

grammar com.yakindu.hmi.sctmodel.HMIText with org.yakindu.sct.model.stext.SText

/* ---- root rules ----These root rules are not relevant for the into a single grammar. */Root: (roots+=DefRoot)*;

Declaration returns sct::Declaration: EventDefinition | VariableDefinition | Clock | Operation

| LocalReaction | Entrypoint | Exitpoint | HMIDeclaration;

HMIDeclaration: HmiScene | HmiPopup | HmiAnimation | HmiTransition;HmiScene: 'scene' scene=[contract::Scene|QID];HmiPopup: 'popup' popup=[contract::Popup|QID];HmiAnimation: 'animation' animation=[contract::Animation|QID];

HMI Declarations

grammar org.yakindu.sct.model.stext.SText with org.eclipse.xtext.common.Terminals

/* ---- root rules ----These root rules are not relevant for the grammar integration

into a single grammar. */Root: (roots+=DefRoot)*;DefRoot: StatechartRoot | StateRoot | TransitionRoot;Scope returns sct::Scope: (SimpleScope | StatechartScope); // a SimpleScope is used for states and regionsSimpleScope returns sct::Scope: {SimpleScope} (declarations+=Declaration)*; // defines the poosible scopes for statechartsStatechartScope returns sct::Scope: InterfaceScope | InternalScope;InterfaceScope returns sct::Scope:

Declarations & Expressions

(SText)

references

extends

exte

ndsDomain Specific

Statechart

Donnerstag, 29. März 12

Page 31: Yakindu Statechart - Domain specific statecharts

Yakindu SCT•Open Source / EPL

• Hosted at EclipseLabs

• Eclipse-Proposal planned for 2012

• Interested parties welcome!

• Important Links:

• Project Site: http://yakindu.org

• Eclipse Labs Site: http://code.google.com/a/eclipselabs.org/p/yakindu/

• Update Site: http://updates.yakindu.com/indigo/milestones/

Donnerstag, 29. März 12

Page 32: Yakindu Statechart - Domain specific statecharts

Thank You! Questions?

Donnerstag, 29. März 12