Meta.ppt 1
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
M2T with Xpand and Xtend Meta.ppt 1 TDT4250 - Model-driven - - PowerPoint PPT Presentation
TDT4250 - Model-driven Development of Information Systems, Autumn 2009 M2T with Xpand and Xtend Meta.ppt 1 TDT4250 - Model-driven Development of Information Systems, Autumn 2009 M2T - model-to-text transformations Why so common?
Meta.ppt 1
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
2
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
text is a ubiquitous format many tools uses text as source, intermediary and target format although text languages are formal, there may not be an
confusing to mix source and target languages,
encoding issues less control of the transformation process, e.g. back-patching,
3
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
defined using Ecore concrete syntax defined with Xtext grammar
SCXML, an XML-based language defined by W3C:
text-based, but has an XML Schema, so we can effectively
transform directly to text transform til Ecore model and serialize
4
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
source and target models have similar concepts
states, transitions, events, conditions, actions
some differences
internal transitions correspond to transitions without a target enter and exit actions are modeled as internal transitions
what about and-decomposition?
implicit in the source language explicit in SCXML: <parallel> ... </parallel>
scripting
scripts occur in events, conditions and actions mostly support in SCXML (extension)
5
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
written using the Xtend sub-language side-effect-free helper methods that are used by the template
text fragments that are copied to the output
everything that are not enclosed in french quotes << >>
expressions that are evaluated and written to output control structures
6
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
based on expressions, not imperative code side-effect-free, but can can change collection values
7
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
conditional execution
bind local variables
part of call to template method, for iterating over collection
the -> operator sequences expressions allows for more procedural code
8
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
defines the output file generates the outer <scxml> element expands the content as a state named “root”
9
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
all variables an initial state
allow only 1
all (sub-)states all transitions
10
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
expand if non-null
11
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
targets, events and conditions are string attributes actions are inner elements
12
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
apache-specific element, i.e. different namespace expands init-expression based on expression sub-type
13
TDT4250 - Model-driven Development of Information Systems, Autumn 2009
apache-specific element, i.e. different namespace expands init-expression based on expression sub-type
14
TDT4250 - Model-driven Development of Information Systems, Autumn 2009