SlideShare une entreprise Scribd logo
1  sur  19
Télécharger pour lire hors ligne
Expressive	and	Efficient	Model	Transformation	
with	an	Internal	DSL	of	Xtend
Artur	Boronat
TL
Scale	OUT	Using	Cloud	Technology…?
TL
Very	Large	Models	(VLMs):
Model	Transformation	(MT)
a	key	bottleneck
Challenge	to	application
in	industry	
Explicitly
Parallelization
[Tisi et	al.	MoDELS’13]
Distribution
[Benelallam et	al.	SLE’15]
Implicitly	(NoSQL)
Models	only
[Gwendal et	al.	Sci.	
Comput.	Program	2017]
MT	too
[Gwendal et	al.	ASE’17]
Scale	UP	with…
Yet	Another	Model	Transformation	Language	!
• Internal	DSL	of	Xtend
• Compiled	to	Java	and	excellent	interoperability	with	JVM	programs
• High-level	API	to	work	with	collections
• Succinct	syntax	to	work	with	lambda	expressions
• IDE	support:	type	checker	and	debugger…
• Focus	on
• expressiveness:	advanced	contructs to	model	MT	using	
ATL as	reference
• efficiency:	MT	performance using	VIATRA3 as	reference
• productivity as	a	consequence	of	being	an	internal	DSL
TL
Krikava et	al.	On	the	use	of	an	internal	DSL	for	enriching	 EMF	models.	OCL	and	Textual	
Modelling. 2012.
Hinkel et	al.	Using	internal	 domain-specific	 languages	to	inherit	 tool	support	 and	modularity	for	
model	transformations.	 SoSyM.	2017.
Expressive	Model	Transformation
MTs in	YAMTL:	ORM	Example
name: String
«stereotype»
NamedElt
«stereotype»
Classifier
DataType
Package
isAbstract: Boolean
Class
*
owner
attr
*
type
*super
*
classifiers
name: String
«stereotype»
Named
Type
Database
Column
Table
*
owner
col
*
type
*
types
*
tables
keyOf
key
*
0..1
name = "Item"
1:Class
multiValued: Boolean
Attribute
name = "product"
multiValued=false
2:Attribute
name = "Order"
4:Class
name = "date"
multiValued=false
3:Attribute
name = "items"
multiValued=true
5:Attribute
attr attr attr
1:Class 4:Class
name = "Item"
1:Table
name = "product"
2:Column
name = "Order"
6:Table
name = "date"
3:Column
name = "pk_Order"
7:Column
col
col
col
name =
"pk_Item"
4:Column
col
name = "fk_Item--items-->Order"
5:Column
col
name = "Item"
1:Table
name = "Invoice"
6:Table
typename = "String"
0:DataType
typetype
0:DataType
Source metamodel (class diagrams) Target metamodel (database schemas)
Initial source model
Propagation of delta a (case 4)
Ms MtInitial target model
TL
YAMTL	Module	Declaration
class cd2db extends YAMTLModule {
new () {
header().in('cd', CD).out('db', DB)
ruleStore(
// rule declarations
)
helperStore(
// helper declarations
)
}
val CD = CDPackage.eINSTANCE
val DB = RelationalPackage.eINSTANCE
// other helpers as Xtend methods
}
Façade	interface:	
loading	models,
execution,	statistics
MT	name
MT	signature	for	
traceable	models
inOut()
for	in-place	MT
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Rule
rule
• matched | lazy | uniqueLazy
• transient
• filter(EXPR): global	constraints
• using(VBLE, EXPR):	local	variables
• endWith(EXPR):	 imperative	expression
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Rule
input	pattern	elements
• with(VBLE) dependencies
• filter(EXPR): local	constraint	(optional)
• derivedWith(EXPR)
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Rule
output	pattern	elements
• action(EXPR) dependencies
• drop()
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Output	Action
fetch
to	access	execution	environment
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Output	Action
fetch
to	resolve	references	in…
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Output	Action
a)	declative rules
new Rule('AttributeToColumn')
.in('att', CD.attribute).filter([ ... ]).build()
.out('col', DB.column, [ ... ]).build()
.build(),
fetch
to	resolve	references	in…
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
new Rule('ClassToTable')
.in('c', CD.class_).build()
.out('t', DB.table, [
// environment vbles
val c = 'c'.fetch as Class
val t = 't'.fetch as Table
val pk_col = 'pk_col'.fetch as Column
// bindings
t.name = c.name
t.col += c.attr.fetch as List<Column>
t.col += pk_col
val list = c.incomingReferences
.fetch('ReferenceToFkColumn')
as List<Column>
if (list !== null)
t.col += list
]).build()
.out('pk_col', DB.column, [
// environment vbles
val c = 'c'.fetch as Class
val pk_col = 'pk_col'.fetch as Column
// bindings
pk_col.name = 'pk_' + c.name
]).build()
.build()
YAMTL	Output	Action
b)	lazy	rules
new Rule('ReferenceToFkColumn')
.uniqueLazy
.in('ref', CD.attribute).build()
.out('fk_col', DB.column, [ ... ]).build()
.build()
a)	declative rules
new Rule('AttributeToColumn')
.in('att', CD.attribute).filter([ ... ]).build()
.out('col', DB.column, [ ... ]).build()
.build(),
fetch
to	resolve	references	in…
name = "Item"
1:Class
name = "Item"
1:Table
name = "pk_Item"
4:Column
col
TL
Reuse	in	YAMTL
• Multiple	Rule	Inheritance	and abstract	rules
• Dispatch	semantics:	leftmost	top-down	search	for	most	concrete	applicable	
rule	for	each	object
• Execution	semantics	of	output	element	actions	(inherits/overriding)
• Module	composition	by	class	extension
• Inheritance:	by	default
• Redefinition:	when	a	rule	(or	a	helper)	in	the	extending	module	have	a	
compatible	interface	with	one	rule	(or	helper)	in	the	extended	module
• Module	reuse in	other	JVM	programs	using	imports
TL
Efficient	Model	Transformation
VIATRA	CPS	Benchmark
YAMTL	solution:
1. Helper to	determine	 receiving	transitions	(waitFor)
2. Build	the	structure	of	deployment	model	using	rules	with	high priority
3. Initialize	triggers	with	a	transient rule	(only	updates)
4. Extract	CPS	traceability	model	from	YAMTL’s	internal	traceability	model
action	triggers	to	be	
set	after	behaviours
are	instantiated
behaviours are	
instantiated	(copy)
traceability	model
TL
VIATRA	CPS	Benchmark
• Adaptation
• Model	generation	with	VIATRA	CPS	model	generator
• Each	experiment	(size):	13	iterations
• Median	of	inner	results	(excluding	1st – warm	up)
1
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
time	(ms)
scale
Client-server
VIATRA EMFTVM Xtend ATL YAMTL EMFTVM	(lazy) ATL	(lazy)
scale factor
time	(ms)
YAMTL
EMFTVM
(imp.)
EIQEMFTVM
(decl.)
ATL2010
(imp.)
ATL2010
(decl.)
Xtend
(optimized)
8 3k 7k 7 45 36 35 120 124 258
16 5k 15k 14 74 56 65 195 201 979
32 10k 29k 26 113 94 102 445 438 3579
64 20k 59k 49 226 190 212 1400 1346 26865
128 40k 123k 102 480 408 473 5316 4916 54594
256 80k 229k 216 768 786 827 20806 20595 223874
512 160k 453k 450 1442 1607 1887 107526 120443
1024 319k 940k 927 2935 3563 5288
2048 636k 1,940k 1889 6019 7800 15942
4096 1.27M 3.69M 3724 10141 15735 50886
8192 2.54M 7.25M 7610 19145 32866 184803
16384 5.08M 14.26M 15838 36490 72377
32768 10.16M 27.53M 32680 67969 oom
• Findings
• YAMTL	at	least	one	
orders	of	magnitud
faster	than	EIQ
• YAMTL	also	uses	
resources	
efficiently
• ATL/EMFTVM	with	
lazy	rules	scales	
well	but	trafo not	
complete
TL
Final	Remarks
https://yamtl.github.io/
• YAMTL	brings	declarative	M2M	transformations to	the	Xtend world
• Advanced model	transformation	constructs
• Support	 for	VLMs/good	performance
• Productivity and	analysis	tools	available	via	Xtend/Java
• Next:	Incremental	MT - most	scalable	solution	of	TTC’18
• Interested	in	exploring	applications
• Thanks	to	Ábel Hegedüs for	integrating	YAMTL	
solution	in	official	VIATRA	CPS	Benchmark
Thank	you	for	your	attention
Artur	Boronat

Contenu connexe

Tendances

Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)RichardWarburton
 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from javaIndicThreads
 
Functional Java 8 in everyday life
Functional Java 8 in everyday lifeFunctional Java 8 in everyday life
Functional Java 8 in everyday lifeAndrea Iacono
 
Learning Functional Programming Without Growing a Neckbeard
Learning Functional Programming Without Growing a NeckbeardLearning Functional Programming Without Growing a Neckbeard
Learning Functional Programming Without Growing a NeckbeardKelsey Gilmore-Innis
 
Functional Programming in Scala: Notes
Functional Programming in Scala: NotesFunctional Programming in Scala: Notes
Functional Programming in Scala: NotesRoberto Casadei
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in ScalaDamian Jureczko
 
Scala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian DragosScala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian Dragos3Pillar Global
 
Generics in .NET, C++ and Java
Generics in .NET, C++ and JavaGenerics in .NET, C++ and Java
Generics in .NET, C++ and JavaSasha Goldshtein
 
Semantic Analysis using Wikipedia Taxonomy
Semantic Analysis using Wikipedia TaxonomySemantic Analysis using Wikipedia Taxonomy
Semantic Analysis using Wikipedia TaxonomyPatrick Nicolas
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In PracticeMichiel Borkent
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffJAX London
 
Future vs. Monix Task
Future vs. Monix TaskFuture vs. Monix Task
Future vs. Monix TaskHermann Hueck
 
Introduction to programming in scala
Introduction to programming in scalaIntroduction to programming in scala
Introduction to programming in scalaAmuhinda Hungai
 
Scala: functional programming for the imperative mind
Scala: functional programming for the imperative mindScala: functional programming for the imperative mind
Scala: functional programming for the imperative mindSander Mak (@Sander_Mak)
 
Ankara Jug - Practical Functional Programming with Scala
Ankara Jug - Practical Functional Programming with ScalaAnkara Jug - Practical Functional Programming with Scala
Ankara Jug - Practical Functional Programming with ScalaEnsar Basri Kahveci
 

Tendances (20)

Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)Pragmatic functional refactoring with java 8 (1)
Pragmatic functional refactoring with java 8 (1)
 
Scala collections api expressivity and brevity upgrade from java
Scala collections api  expressivity and brevity upgrade from javaScala collections api  expressivity and brevity upgrade from java
Scala collections api expressivity and brevity upgrade from java
 
Functional Java 8 in everyday life
Functional Java 8 in everyday lifeFunctional Java 8 in everyday life
Functional Java 8 in everyday life
 
Learning Functional Programming Without Growing a Neckbeard
Learning Functional Programming Without Growing a NeckbeardLearning Functional Programming Without Growing a Neckbeard
Learning Functional Programming Without Growing a Neckbeard
 
Functional Programming in Scala: Notes
Functional Programming in Scala: NotesFunctional Programming in Scala: Notes
Functional Programming in Scala: Notes
 
Java 8: the good parts!
Java 8: the good parts!Java 8: the good parts!
Java 8: the good parts!
 
Scala for curious
Scala for curiousScala for curious
Scala for curious
 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
 
Scala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian DragosScala: Object-Oriented Meets Functional, by Iulian Dragos
Scala: Object-Oriented Meets Functional, by Iulian Dragos
 
Generics in .NET, C++ and Java
Generics in .NET, C++ and JavaGenerics in .NET, C++ and Java
Generics in .NET, C++ and Java
 
Scala - core features
Scala - core featuresScala - core features
Scala - core features
 
Semantic Analysis using Wikipedia Taxonomy
Semantic Analysis using Wikipedia TaxonomySemantic Analysis using Wikipedia Taxonomy
Semantic Analysis using Wikipedia Taxonomy
 
Functional Programming in Scala
Functional Programming in ScalaFunctional Programming in Scala
Functional Programming in Scala
 
Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In Practice
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
Future vs. Monix Task
Future vs. Monix TaskFuture vs. Monix Task
Future vs. Monix Task
 
Introduction to programming in scala
Introduction to programming in scalaIntroduction to programming in scala
Introduction to programming in scala
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Scala: functional programming for the imperative mind
Scala: functional programming for the imperative mindScala: functional programming for the imperative mind
Scala: functional programming for the imperative mind
 
Ankara Jug - Practical Functional Programming with Scala
Ankara Jug - Practical Functional Programming with ScalaAnkara Jug - Practical Functional Programming with Scala
Ankara Jug - Practical Functional Programming with Scala
 

Similaire à Expressive and Efficient Model Transformation with an Internal DSL of Xtend

SQL Server Select Topics
SQL Server Select TopicsSQL Server Select Topics
SQL Server Select TopicsJay Coskey
 
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...Cathrine Wilhelmsen
 
Apache Cassandra Data Modeling with Travis Price
Apache Cassandra Data Modeling with Travis PriceApache Cassandra Data Modeling with Travis Price
Apache Cassandra Data Modeling with Travis PriceDataStax Academy
 
Glorp Tutorial Guide
Glorp Tutorial GuideGlorp Tutorial Guide
Glorp Tutorial GuideESUG
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.pptMARasheed3
 
SenchaCon 2016: The Once and Future Grid - Nige White
SenchaCon 2016: The Once and Future Grid - Nige WhiteSenchaCon 2016: The Once and Future Grid - Nige White
SenchaCon 2016: The Once and Future Grid - Nige WhiteSencha
 
Practical Machine Learning Pipelines with MLlib
Practical Machine Learning Pipelines with MLlibPractical Machine Learning Pipelines with MLlib
Practical Machine Learning Pipelines with MLlibDatabricks
 
c#(loops,arrays)
c#(loops,arrays)c#(loops,arrays)
c#(loops,arrays)sdrhr
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7Akash Tyagi
 
The Ring programming language version 1.8 book - Part 39 of 202
The Ring programming language version 1.8 book - Part 39 of 202The Ring programming language version 1.8 book - Part 39 of 202
The Ring programming language version 1.8 book - Part 39 of 202Mahmoud Samir Fayed
 
Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5Donal Fellows
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql newSANTOSH RATH
 
Be A Hero: Transforming GoPro Analytics Data Pipeline
Be A Hero: Transforming GoPro Analytics Data PipelineBe A Hero: Transforming GoPro Analytics Data Pipeline
Be A Hero: Transforming GoPro Analytics Data PipelineChester Chen
 
Templates presentation
Templates presentationTemplates presentation
Templates presentationmalaybpramanik
 
Ch03_stacks_and_queues.ppt
Ch03_stacks_and_queues.pptCh03_stacks_and_queues.ppt
Ch03_stacks_and_queues.pptOliverKane3
 

Similaire à Expressive and Efficient Model Transformation with an Internal DSL of Xtend (20)

SQL Server Select Topics
SQL Server Select TopicsSQL Server Select Topics
SQL Server Select Topics
 
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
 
Apache Cassandra Data Modeling with Travis Price
Apache Cassandra Data Modeling with Travis PriceApache Cassandra Data Modeling with Travis Price
Apache Cassandra Data Modeling with Travis Price
 
Developing a new Epsilon EMC driver
Developing a new Epsilon EMC driverDeveloping a new Epsilon EMC driver
Developing a new Epsilon EMC driver
 
Glorp Tutorial Guide
Glorp Tutorial GuideGlorp Tutorial Guide
Glorp Tutorial Guide
 
dbs class 7.ppt
dbs class 7.pptdbs class 7.ppt
dbs class 7.ppt
 
SenchaCon 2016: The Once and Future Grid - Nige White
SenchaCon 2016: The Once and Future Grid - Nige WhiteSenchaCon 2016: The Once and Future Grid - Nige White
SenchaCon 2016: The Once and Future Grid - Nige White
 
Practical Machine Learning Pipelines with MLlib
Practical Machine Learning Pipelines with MLlibPractical Machine Learning Pipelines with MLlib
Practical Machine Learning Pipelines with MLlib
 
c#(loops,arrays)
c#(loops,arrays)c#(loops,arrays)
c#(loops,arrays)
 
Vertica-Database
Vertica-DatabaseVertica-Database
Vertica-Database
 
QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7QTP Automation Testing Tutorial 7
QTP Automation Testing Tutorial 7
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Templates2
Templates2Templates2
Templates2
 
The Ring programming language version 1.8 book - Part 39 of 202
The Ring programming language version 1.8 book - Part 39 of 202The Ring programming language version 1.8 book - Part 39 of 202
The Ring programming language version 1.8 book - Part 39 of 202
 
Etl2
Etl2Etl2
Etl2
 
Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5Making an Object System with Tcl 8.5
Making an Object System with Tcl 8.5
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
 
Be A Hero: Transforming GoPro Analytics Data Pipeline
Be A Hero: Transforming GoPro Analytics Data PipelineBe A Hero: Transforming GoPro Analytics Data Pipeline
Be A Hero: Transforming GoPro Analytics Data Pipeline
 
Templates presentation
Templates presentationTemplates presentation
Templates presentation
 
Ch03_stacks_and_queues.ppt
Ch03_stacks_and_queues.pptCh03_stacks_and_queues.ppt
Ch03_stacks_and_queues.ppt
 

Dernier

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Dernier (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Expressive and Efficient Model Transformation with an Internal DSL of Xtend

  • 3.
  • 4. Scale UP with… Yet Another Model Transformation Language ! • Internal DSL of Xtend • Compiled to Java and excellent interoperability with JVM programs • High-level API to work with collections • Succinct syntax to work with lambda expressions • IDE support: type checker and debugger… • Focus on • expressiveness: advanced contructs to model MT using ATL as reference • efficiency: MT performance using VIATRA3 as reference • productivity as a consequence of being an internal DSL TL Krikava et al. On the use of an internal DSL for enriching EMF models. OCL and Textual Modelling. 2012. Hinkel et al. Using internal domain-specific languages to inherit tool support and modularity for model transformations. SoSyM. 2017.
  • 6. MTs in YAMTL: ORM Example name: String «stereotype» NamedElt «stereotype» Classifier DataType Package isAbstract: Boolean Class * owner attr * type *super * classifiers name: String «stereotype» Named Type Database Column Table * owner col * type * types * tables keyOf key * 0..1 name = "Item" 1:Class multiValued: Boolean Attribute name = "product" multiValued=false 2:Attribute name = "Order" 4:Class name = "date" multiValued=false 3:Attribute name = "items" multiValued=true 5:Attribute attr attr attr 1:Class 4:Class name = "Item" 1:Table name = "product" 2:Column name = "Order" 6:Table name = "date" 3:Column name = "pk_Order" 7:Column col col col name = "pk_Item" 4:Column col name = "fk_Item--items-->Order" 5:Column col name = "Item" 1:Table name = "Invoice" 6:Table typename = "String" 0:DataType typetype 0:DataType Source metamodel (class diagrams) Target metamodel (database schemas) Initial source model Propagation of delta a (case 4) Ms MtInitial target model TL
  • 7. YAMTL Module Declaration class cd2db extends YAMTLModule { new () { header().in('cd', CD).out('db', DB) ruleStore( // rule declarations ) helperStore( // helper declarations ) } val CD = CDPackage.eINSTANCE val DB = RelationalPackage.eINSTANCE // other helpers as Xtend methods } Façade interface: loading models, execution, statistics MT name MT signature for traceable models inOut() for in-place MT TL
  • 8. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Rule rule • matched | lazy | uniqueLazy • transient • filter(EXPR): global constraints • using(VBLE, EXPR): local variables • endWith(EXPR): imperative expression name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 9. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Rule input pattern elements • with(VBLE) dependencies • filter(EXPR): local constraint (optional) • derivedWith(EXPR) name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 10. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Rule output pattern elements • action(EXPR) dependencies • drop() name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 11. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Output Action fetch to access execution environment name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 12. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Output Action fetch to resolve references in… name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 13. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Output Action a) declative rules new Rule('AttributeToColumn') .in('att', CD.attribute).filter([ ... ]).build() .out('col', DB.column, [ ... ]).build() .build(), fetch to resolve references in… name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 14. new Rule('ClassToTable') .in('c', CD.class_).build() .out('t', DB.table, [ // environment vbles val c = 'c'.fetch as Class val t = 't'.fetch as Table val pk_col = 'pk_col'.fetch as Column // bindings t.name = c.name t.col += c.attr.fetch as List<Column> t.col += pk_col val list = c.incomingReferences .fetch('ReferenceToFkColumn') as List<Column> if (list !== null) t.col += list ]).build() .out('pk_col', DB.column, [ // environment vbles val c = 'c'.fetch as Class val pk_col = 'pk_col'.fetch as Column // bindings pk_col.name = 'pk_' + c.name ]).build() .build() YAMTL Output Action b) lazy rules new Rule('ReferenceToFkColumn') .uniqueLazy .in('ref', CD.attribute).build() .out('fk_col', DB.column, [ ... ]).build() .build() a) declative rules new Rule('AttributeToColumn') .in('att', CD.attribute).filter([ ... ]).build() .out('col', DB.column, [ ... ]).build() .build(), fetch to resolve references in… name = "Item" 1:Class name = "Item" 1:Table name = "pk_Item" 4:Column col TL
  • 15. Reuse in YAMTL • Multiple Rule Inheritance and abstract rules • Dispatch semantics: leftmost top-down search for most concrete applicable rule for each object • Execution semantics of output element actions (inherits/overriding) • Module composition by class extension • Inheritance: by default • Redefinition: when a rule (or a helper) in the extending module have a compatible interface with one rule (or helper) in the extended module • Module reuse in other JVM programs using imports TL
  • 17. VIATRA CPS Benchmark YAMTL solution: 1. Helper to determine receiving transitions (waitFor) 2. Build the structure of deployment model using rules with high priority 3. Initialize triggers with a transient rule (only updates) 4. Extract CPS traceability model from YAMTL’s internal traceability model action triggers to be set after behaviours are instantiated behaviours are instantiated (copy) traceability model TL
  • 18. VIATRA CPS Benchmark • Adaptation • Model generation with VIATRA CPS model generator • Each experiment (size): 13 iterations • Median of inner results (excluding 1st – warm up) 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 time (ms) scale Client-server VIATRA EMFTVM Xtend ATL YAMTL EMFTVM (lazy) ATL (lazy) scale factor time (ms) YAMTL EMFTVM (imp.) EIQEMFTVM (decl.) ATL2010 (imp.) ATL2010 (decl.) Xtend (optimized) 8 3k 7k 7 45 36 35 120 124 258 16 5k 15k 14 74 56 65 195 201 979 32 10k 29k 26 113 94 102 445 438 3579 64 20k 59k 49 226 190 212 1400 1346 26865 128 40k 123k 102 480 408 473 5316 4916 54594 256 80k 229k 216 768 786 827 20806 20595 223874 512 160k 453k 450 1442 1607 1887 107526 120443 1024 319k 940k 927 2935 3563 5288 2048 636k 1,940k 1889 6019 7800 15942 4096 1.27M 3.69M 3724 10141 15735 50886 8192 2.54M 7.25M 7610 19145 32866 184803 16384 5.08M 14.26M 15838 36490 72377 32768 10.16M 27.53M 32680 67969 oom • Findings • YAMTL at least one orders of magnitud faster than EIQ • YAMTL also uses resources efficiently • ATL/EMFTVM with lazy rules scales well but trafo not complete TL
  • 19. Final Remarks https://yamtl.github.io/ • YAMTL brings declarative M2M transformations to the Xtend world • Advanced model transformation constructs • Support for VLMs/good performance • Productivity and analysis tools available via Xtend/Java • Next: Incremental MT - most scalable solution of TTC’18 • Interested in exploring applications • Thanks to Ábel Hegedüs for integrating YAMTL solution in official VIATRA CPS Benchmark Thank you for your attention Artur Boronat