SlideShare a Scribd company logo
APPROACHES TO MODEL
TRANSFORMATION REUSE
ICMT’2016, Viena
Juan de Lara
joint work with
Esther Guerra and Jesús Sánchez Cuadrado
Modelling&Software Engineering Research Group
http://miso.es @miso_uam
FROM CONCEPTS TO
A-POSTERIORI TYPING
Juan de Lara
joint work with
Esther Guerra and Jesús Sánchez Cuadrado
Modelling&Software Engineering Research Group
http://miso.es @miso_uam
ICMT’2016, Viena
Model-transformations are the key elements
for automation in model-based approaches
MOTIVATION
3
Domain-specific
languages
Proliferation of domain
meta-models
MOTIVATION
4
Transformations are defined over specific meta-models
Difficult to reuse for other related meta-models
How to avoid creating (essentially)
the same transformation for
different meta-models?
MOTIVATION:
PROCESS MODELS TO PETRI NETS
5
Task
name: String
initial: boolean
next
* Place
Transitionid: String
tokens: int
inps
outs
*
*
6
press
wait
cross
start
start
press
wait
cross
Task
name: String
initial: boolean
next
* Place
Transitionid: String
tokens: int
inps
outs
*
*
MOTIVATION:
PROCESS MODELS TO PETRI NETS
task2PN
7
L R=NAC
t:Task
name=n
t:Task
name=n
:Place
id=n
tokens=t.initial?1:0
t1:Task
t2:Task
:next
p1:Place
p2:Place
t1:Task
t2:Task
:next
p1:Place
p2:Place
:Transition
:inps
:outs
L R=NAC
TRANSFORMATION
(GRAPH BASED)
8
TRANSFORMATION
(ATL)
rule Task2Place {
from t : Process!Task
to p : PN!Place (
id <- t.name,
tokens <- if t.initial then 1 else 0 endif
)
}
rule next2Transition {
from t1 : Process!Task,
t2 : Process!Task (t1.next->includes(t2))
to tr : PN!Transition (
inps <- t1,
outs <- t2
)
}
…
REUSE FOR ANOTHER
META-MODEL
9
Task
name: String
initial: boolean
next
* Place
Transitionid: String
tokens: int
inps
outs
*
*
Activity
ident: String
InitialActivity
task2PN
FlowEdge
from
to
10
rule Task2Place {
from t : Process!Task
to p : PN!Place (
id <- t.name,
tokens <- if t.initial then 1 else 0 endif
)
}
rule next2Transition {
from t1 : Process!Task,
t2 : Process!Task (t1.next->includes(t2))
to tr : PN!Transition (
inps <- t1,
outs <- t2
)
}
…
AD-HOC REUSE (COPY+ADAPT)
AD-HOC REUSE (COPY+ADAPT)
11
rule Task2Place {
from t : Process!Activity
to p : PN!Place (
id <- t.ident,
tokens <- if t.oclIsTypeOf(Process!InitialActivity) then
1 else 0 endif
)
}
rule next2Transition {
from t1 : Process!Activity,
t2 : Process!Activity
(Process!FlowEdge.allInstances()->exist(e |
e.from=t1 and e.to=t2))
to tr : PN!Transition (
inps <- t1,
outs <- t2
)
}
AD-HOC REUSE (COPY+ADAPT)
12
rule Task2Place {
from t : Process!Activity
to p : PN!Place (
name <- t.ident,
tokens <- if t.oclIsTypeOf(Process!InitialActivity) then
1 else 0 endif
)
}
rule next2Transition {
from t1 : Process!Activity,
t2 : Process!Activity
(Process!FlowEdge.allInstances()->exist(e |
e.from=t1 and e.to=t2))
to tr : PN!Transition (
inps <- t1,
outs <- t2
)
}
• Complex and error prone
• Repetitive
• Does not scale to large
transformations
EXPLICIT MODEL ADAPTATION
1313
Task
name: String
initial: boolean
next
* Place
Transitionid: String
tokens: int
inps
outs
*
*
Activity
ident: String
InitialActivity
task2PN
FlowEdge
from
to
activity2task;task2PN
activity2task
MOTIVATION
14
rule Activity2Task {
from t : Activities!Activity
to p : Process!Task (
id <- t.ident,
initial <- t.oclIsKindOf(Activities!InitialActivity),
next <- Activities!FlowEdge.allInstances()->
select (e | e.from = t)->
collect(e | e.to )
)
}
t:
InitialActivity
ident=“a0”
p: Task
name=“a0”
initial=true
pl: Place
name=“a0”
tokens=1
activity2task task2PN
MOTIVATION
15
rule Activity2Task {
from t : Activities!Activity
to p : Process!Task (
name <- t.ident,
initial <- t.oclIsKindOf(Activities!InitialActivity),
next <- Activities!FlowEdge.allInstances()->
select (e | e.from = t)->
collect(e | e.to )
)
}
• Three models involved,
complicates traceability
• Two transformations: less
efficient
• May require a transformation
back to the initial model
Concept-based reuse
de Lara, Guerra. “From types to type requirements: genericity for model-driven
engineering”. SoSyM 2103.
Sánchez Cuadrado, Guerra, de Lara. “A Component Model for Model
Transformations”. IEEE Trans. Software Eng. 2014.
Multi-level based reuse
de Lara, Guerra, Sánchez Cuadrado. “Model-driven engineering with domain
specific meta-modelling languages”. SoSyM 2015.
A-posteriori typing
de Lara, Guerra, Sánchez Cuadrado. “A-posteriori typing for Model-Driven
Engineering”. MoDELS 2015: 156-165
Transformation co-evolution
Di Ruscio, Iovino, Pierantonio. “A Methodological Approach for the Coupled
Evolution of Metamodels and ATL Transformations”. ICMT’13
Model (sub-)typing
Steel, Jezequel. “On Model Typing”. SoSyM 2007.
Guy, et al. “On Model Subtyping”. ECMFA'12.
SO WHAT?
16
Concept-based reuse
de Lara, Guerra. “From types to type requirements: genericity for model-driven
engineering”. SoSyM 2103.
Sánchez Cuadrado, Guerra, de Lara. “A Component Model for Model
Transformations”. IEEE Trans. Software Eng. 2014.
Multi-level based reuse
de Lara, Guerra, Sánchez Cuadrado. “Model-driven engineering with domain
specific meta-modelling languages”. SoSyM 2015.
A-posteriori typing
de Lara, Guerra, Sánchez Cuadrado. “A-posteriori typing for Model-Driven
Engineering”. MoDELS 2015: 156-165
Transformation co-evolution
Di Ruscio, Iovino, Pierantonio. “A Methodological Approach for the Coupled
Evolution of Metamodels and ATL Transformations”. ICMT’13
Model (sub-)typing
Steel, Jezequel. “On Model Typing”. SoSyM 2007.
Guy, et al. “On Model Subtyping”. ECMFA'12.
SO WHAT?
17
Automate ad-hoc copy-adaptation:
CONCEPT-BASED REUSE
18
Concept
Msrc Mtar
from to
«conforms to» «conforms to»
Template
execution
MMsrc
Instantiated
template
to
binding
MMtar
HOT
Transformation
template
definition
from
Final user
Transformation
developer
(with reuse)
Transformation
developer
(for reuse)
1
2 3
4
• Transformations defined over “concepts”
• Binding to concrete meta-model
• Automated transformation adaptation
19
STRUCTURAL
CONCEPTS
Structural Concepts.
• They gather the structure needed
from meta-models for the
transformation to be applicable.
• They have the form of a meta-
model as well.
SimpleTask concept
Task
name: String
initial: boolean
next
*
Their elements are treated as variables, which need to be bound
to elements in specific meta-models.
Interface of the transformation
• No superflous elements
• No extra complexity
• Transformations become as simple as possible
20
REUSABLE
TRANSFORMATIONS
Transformations defined using the types of the concept.
L R=NAC
t:Task
name=n
t:Task
name=n
:Place
id=n
tokens=t.initial?1:0
t1:Task
t2:Task
:next
p1:Place
p2:Place
t1:Task
t2:Task
:next
p1:Place
p2:Place
:Transition
:inps
:outs
L R=NAC
21
BINDING
Concept binding:
• Bind each element in the
concept to an element in the
meta-model.
Task SETask
name  id
initial  isInitial
next  following
Binding SETaskEngineer
Coding Testing
actors
*
Software Engineering processes
Design
SimpleTask concept
Task
name: String
initial: boolean
next
*
Analysis
id: String
isInitial: boolean
following
0..5
ADAPTATION
The transformation gets automatically adapted
Similar to template instantiation in generic programming
22
t:SETask
id=n
t:SETask
id=n
:Place
id=n
tokens=t.isInitial?1:0
t1:SETask
t2:SETask
:following
p1:Place
p2:Place
t1:SETask
t2:SETask
:following
p1:Place
p2:Place
:Transition
:inps
:outs
WAIT A MOMENT…
IS THE RESULTING
TRANSFORMATION
CORRECT?
Rules for the binding
• Cardinalities
• Composition, features, subtyping, etc
Depends on what you do with the concept
• Read only (e.g., for M2M transformation)
• Write (e.g., for in-place transformation)
23
SETaskTask
SETaskTask
Concept Meta-modelbinding
R
W
Sánchez Cuadrado, Guerra, de Lara. “Flexible Model-to-Model Transformation Templates: An Application
to ATL”. JOT 2012.
Task next
* SETask
R following 0..5
SETask
following 0..5
Task next
*
W
WAIT A MOMENT…
ISN’T THIS JUST A
RENAMING?
HOW FLEXIBLE IS THE
BINDING?
Basic binding
• Renaming of types, attributes
• N-to-1 mappings
More flexibility is needed in practice
• Hybrid concepts
• Cardinalities in concept elements
• Adapters
24
25
MORE FLEXIBLE
BINDINGS
Concepts express a
particular design choice on
how structure is organized
Different meta-models may
implement the same
structure differently
• Association as
intermediate class
• Enumerate as subclases
• etc.
binding
Task
name: String
initial: boolean
next
*
Activity
ident: String
InitialActivity
FlowEdge
from
to
26
HYBRID CONCEPTS
Hide “unessential” structure behind
required operations
Operations need to be implemented
together with the binding
The generic transformation may use
these required operations
Task
getName(): String
isInitial():boolean
getNext(): Task[*]
SimpleTask hybrid
concept
27
HYBRID CONCEPTS
operation Activity getName() : String { return self.ident }
operation Activity isInitial() : boolean { return false; }
operation Activity getNext() : Set(Activity) {
return FlowEdge.all.select(f|f.from=self).collect(f|f.to);
}
operation InitialActivity isInitial() : boolean { return true;}
Task  Activity
binding
28
HYBRID CONCEPTS
operation Activity getName() : String { return self.ident }
operation Activity isInitial() : boolean { return false; }
operation Activity getNext() : Set(Activity) {
return FlowEdge.all.select(f|f.from=self).collect(f|f.to);
}
operation InitialActivity isInitial() : boolean { return true;}
Task  Activity
binding
Allows bridging a large number of
heterogeneities
The generic transformation needs
to be written using these
operations. Difficult for e.g. graph
transformation approaches
29
BINDING ADAPTERS
Elements in the concept are variables
• Allow binding them to expressions: adapters
Adapters resolve the heterogeneities between the
concept and the meta-model
They induce an adaptation of the transformation
rule Task2Place {
from t : Pr!Task
to p : PN!Place (
tokens <- if t.initial
then 1 else 0
endif )}
30
Task
initial: boolean
next
*
Concept
Activity
InitialActivity
Flow
Edge
from
to
Task  Activity
Task.initial  if (self.oclIsKindOf(InitialActivity)) then
true else false endif
Task.next  FlowEdge.allInstances()->
select(e|e.from=self)->
collect(to)
Meta-model
typed on
helper context Pr!Activity
def: initial : Boolean =
if (…) then true else
false endif;
rule Task2Place {
from t : Pr!Activity
to p : PN!Place (
tokens <- if t.initial
then 1 else 0
endif )}
typed on
adaptation
31
ADAPTERS VS
HYBRID CONCEPTS
Bridge a large number of
heterogeneities
The generic transformation
remains agnostic w.r.t. the
binding
Adaptation mechanism
dependent on the
particular transformation
language (e.g., ATL)
Bridge a large number of
heterogeneities
The generic
transformation needs to
be written using
operations
Adaptation mechanism
dependent on the
particular transformation
language (e.g., Epsilon)
Hybrid concepts Adapters
WAIT A MOMENT…
Aren’t concepts characterizing a set of “suitable”
meta-models for the transformation?
Isn’t that exactly what meta-models do (for
models)?
Concepts as meta-meta-models
Rely on typing: no need to adapt the
transformation
32
Language families as instances of a
common meta-model
MULTI-LEVEL BASED
REUSE
33
Process Modelling
Software Process
Modelling Language
Educational
Modelling Language
Software Process
Models
Educational
Models
34
MULTI-LEVEL BASED
GENERICITY
Transformations can be
defined at the top meta-level
Applicable to instances of
all languages in the family
Process Modelling
Software Process
Modelling Language
Educational
Modelling Language
Software Process
Models
Educational
Models
…
Transformation
defined on
applicableto
35
MULTI-LEVEL BASED
GENERICITY
Task
Kind
Gateway
Kind
Seq Par
src
tar
*
*
Test: TaskKindCoding:TaskKind
T2C: Seq
C2T: Seq
src tar
srctar
data:
Coding
unitDt:
Test
gui:
Coding
: C2T
src
tar
: T2C
tar
src
«conf»
«conf» data:
Coding
unitDT:
Test
gui:
Coding
rule Task2Place
transform t : Level0!TaskKind
to p : Place
{
...
}
....
defined on
rule Task2Place
transform t : Level0!TaskKind
to p : Place
{
...
}
....
36
MULTI-LEVEL BASED
GENERICITY
data:
Coding
unitDT:
Test
gui:
Coding
rule Coding2Place
transform t : Coding
to p : Place
{…}
rule Test2Place
transform t : Test
to p : Place
{…}
defined
on
data:
Coding
unitDt:
Test
gui:
Coding
: C2T
src
tar
: T2C
tar
src
«conf»
Task
Kind
Gateway
Kind
Seq Par
src
tar
*
*
Test: TaskKindCoding:TaskKind
T2C: Seq
C2T: Seq
src tar
srctar
«conf»
37
MULTI-LEVEL VS CONCEPT-
BASED GENERICITY
Concept-based Genericity
Multi-level-based Genericity
• A posteriori binding: meta-
models may exist first.
• Adapters and hybrid concepts
to solve heterogeneities.
• A priori: meta-meta-model
should exist first.
• Ability to apply an operation
several meta-levels below.
• Domain-Specific meta-
modelling.
38
CAN WE GET THE BEST OF
BOTH APPROACHES?
• A posteriori binding:
meta-models may exist
first.
• Adapters or Hybrid
concepts to solve
heterogeneities.
• Independence of the
transformation
language
Concept-based reuse Multi-level reuse
39
CAN WE GET THE BEST OF
BOTH APPROACHES?
• A posteriori binding:
meta-models may exist
first.
• Adapters to solve
heterogeneities.
• Independence of the
transformation
language
Concept-based reuse Multi-level reuse
Let’s make the typing relation:
• A-posteriori
• As flexible as adapters
A-POSTERIORI TYPING
40
A more flexible typing mechanism for MDE
Decouple instantiation from classification
• Interfaces in object-oriented programming
• Roles in role-based programming languages
Allow dynamic typing and multiple classifiers for objects
Type and instance-level reclassification specifications
CONSTRUCTIVE VS
A-POSTERIORI TYPING
41
Task
start: Date
duration: int
name: String
review: Task
start= 8/5/15
duration= 30
name= “rev”
creation «instance of»
Measurable
quantity: int
Schedulable
date: Date
review: Task
Tasks meta-model
model
Scheduling MM Measuring MM
model
«instance of» «instance of»
start= 8/5/15
duration= 30
name= “rev”
«Schedulable,Measurable»
Constructive typing A-posteriori typing
Constructive typing A-posteriori typing
42
*topics
*
*
res
Task
start: Date
duration: int
name: String
Tasks meta-model (constructive types)
Resource
Person
owner
assigned
1..* 1..*
0..3
reviewsArticle
title: String
Conference meta-model (dynamic types)
Reviewer
Authorauthors
Topic
desc: String
«Author»
p2: Person
«Reviewer»
p1: Person
«Article»
r: Resource
:owner
t1:Task
start: 8/5/15
duration: 30
name: “rev”
:res
:assigned
«Author,Reviewer»
p2: Person
«Reviewer»
p1: Person
«Article»
r: Resource
:owner
t1:Task
start: 8/5/15
duration: 30
name: “rev”
:res
:assigned
«Author»
p3: Person
«Article»
s: Resource
:owner
t2:Task
start: 9/5/15
duration: 30
name: “rev”
:res
:assigned
the model
changes
and gets
retyped
creation «instance of»
model
• A Person (constructive type) is only a Reviewer (a posteriori type)
when some condition is met.
A-POSTERIORI TYPING:
FLEXIBLE REUSE
SPECIFYING AP TYPINGS
AT THE TYPE-LEVEL
43
Schedulable
date: Date
span: double
review: Task
Tasks meta-model ( MMC )
start= 8/5/15
/months= 1
duration= 30
name= “rev”
Scheduling MM ( MMR )
Task
start: Date
duration: int
name: String
Typing Specification
Task  Schedulable
self.start  date
/months: double=self.duration/30  span
«Schedulable»
«date»
«span»
creation «instance of»
(constructive)
«instance of»
(a-posteriori)
• Derived attributes (months) defined in the typing
specification.
• Typing rules: ensure syntactic correctness
TYPE-LEVEL AP TYPING
44
date: Date
span: double
writing: Task
start= 15/3/15
duration= 90
name= “wrt”
review: Task
start= 8/5/15
duration= 30
name= “rev”
Schedulable
Scheduling MM (MMR)
Instance model of Tasks ( MMC )
«instance of»
(a-posteriori)
“Scheduling glasses”
Operations
review:
Schedulable
date= 8/5/15
span= 1
{review, writing}
{1, 3}
Schedulable.allInstances()
writing:
Schedulable
date= 15/3/15
span= 3
Schedulable.allInstances()->
collect(span)
SPECIFYING AP TYPINGS AT
THE INSTANCE LEVEL
45
date: Date
span: double
writing: Task
start= 15/3/15
duration= 90
name= “wrt”
review: Task
start= 8/5/15
/months= 1
duration= 30
name= “rev”
«Schedulable»
«date»
«instance of»
(a-posteriori)
Schedulable
Scheduling MM (MMR)
Typing Specification
Task.allInstances()->select(duration<80)
 Schedulable
self.start  date
/months: double=self.duration/30  span
Instance model of Tasks ( MMC )
«span»
• Typing defined by queries.
• Derived attributes defined by queries as well.
INSTANCE-LEVEL AP TYPING
46
Operations
date: Date
span: double
writing: Task
start= 15/3/15
duration= 90
name= “wrt”
review: Task
start= 8/5/15
duration= 30
name= “rev”
Schedulable
Scheduling MM (MMR)
Instance model of Tasks ( MMC )
«instance of»
(a-posteriori)
review: Schedulable
date= 8/5/15
span= 1
Schedulable.allInstances()->
collect(span)
{review}
{1}
Schedulable.allInstances()
“Scheduling glasses”
INSTANCE-LEVEL AP TYPING
47
Operations
date: Date
span: double
writing: Task
start= 15/3/15
duration= 60
name= “wrt”
review: Task
start= 8/5/15
duration= 30
name= “rev”
Schedulable
Scheduling MM (MMR)
Instance model of Tasks ( MMC )
«instance of»
(a-posteriori)
review:
Schedulable
date= 8/5/15
span= 1
Schedulable.allInstances()->
collect(span)
{review, writing}
{1, 2}
Schedulable.allInstances()
“Scheduling glasses”
writing:
Schedulable
date= 15/3/15
span= 2
Activity  Task
ident  name
/init : boolean =
self.oclsKindOf(InitialActivity)  initial
/follow: Task[*] = FlowEdge.allInstances()->
select(e|e.from=self)->
collect(e|e.to)  next
EXAMPLE
48
Task
name: String
initial: boolean
next
*
Activity
ident: String
InitialActivity
FlowEdge
from
to
Aren’t retypings now a kind of transformation?
Producing a view of a given model
How expressive are retypings considered as
model transformations?
49
WAIT A MOMENT…
A-POSTERIORI TYPING AS A
TRANSFORMATION
50
Task
name: String
initial: boolean
next
Place
Transitionid: String
tokens: int
inps
outs
*
*
task2PN
Task.allInstances()  Place
name  id
/toks : int = if (self.initial) then 1 else 0  tokens
Task.allInstances()->select(t|t.next.isDefined())  Transition
/prevs : Task[*] = Set{self}  inps
/nexts : Task[*] = Set{self.next}  outs
0..1
A-POSTERIORI TYPING AS A
TRANSFORMATION
51
Place
Transitionid: String
tokens: int
inps
outs
*
*
t1:Task
name=“t1”
initial=false
name=“t2”
initial=true
:next
name=“t3”
initial=false
:next
t2:Task
t3:Task
Task
name: String
initial: boolean
next
0..1
task2PN
A-POSTERIORI TYPING AS A
TRANSFORMATION
52
Place
Transitionid: String
tokens: int
inps
outs
*
*
«Place»
«Place, Transition»
«Place, Transition»
«id»
«id»
«id»
Task
name: String
initial: boolean
next
0..1
task2PN
t1:Task
name=“t1”
initial=false
name=“t2”
initial=true
:next
name=“t3”
initial=false
:next
t2:Task
t3:Task
A-POSTERIORI TYPING AS A
TRANSFORMATION
53
Place
Transitionid: String
tokens: int
inps
outs
*
*
t2:Task
t3:Task
«Transition»
«Transition»
«outs»
«outs»
«inps»
«inps»
Task
name: String
initial: boolean
next
0..1
task2PN
«Place»
«Place»
«id»
«id»name=“t2”
initial=true
name=“t3”
initial=false
t2:Task
t3:Task
«Place»
«id»
t1:Task
name=“t1”
initial=false
TYPING AS TRANSFORMATION:
THE GOOD
54
No objects need to be created
• Just retype existing elements
Incrementality (forwards)
• For free
Bidirectionality
• For restricted cases of type-level specifications
• Incrementality (backwards) for (more) restricted cases
Analysis
• Executability
• Totality
• Surjectivity
55
Limited expressivity
• 1-to-1 or N-to-1 mappings
• 1-to-N and N-to-M only in certain cases
No replacement for regular transformation languages
• Helpers, auxiliary operations, etc
Efficiency operations for instance-level specifications
• T.allInstances() needs to compute all objects belonging to T
• Type caches and “smart” update policies
TYPING AS TRANSFORMATION:
THE BAD
ANALYSIS OF
A-POSTERIORI RETYPING
56
Schedulable
date: Date
span: double
Tasks meta-model ( MMC ) Scheduling MM ( MMR )
Task
start: Date
duration: int
name: String
Typing Specification
Task  Schedulable
self.start  date
/months: double=self.duration/30  span
• Creation and role meta-models may have OCL constraints.
• Executability: Can some “Tasks” models become valid
Scheduling models?.
• Totality: Can all Tasks models become valid Scheduling
model?.
• Surjectivity: Can every Scheduling instance be obtained via
retyping some Tasks instance?
CR0: self. span>0
CC0: self. duration<100
57
SO WHAT?
WHAT HAVE WE
GAINED?
• The transformation is
adapted
• Adapters to solve
heterogeneities
• Automate ad-hoc reuse
• Language families
• Independence of the
transformation language
• Transformation applicable
across levels
Concept-based reuse Multi-level reuse
• Independence of the transformation language
• Heterogeneities can be resolved
• Typing becomes dynamic and multiple
• Improve model-adaptation-based reuse
Retyping-based reuse
T l
support
58
TOOL SUPPORT
59
bentō (http://www.miso.es/tools/bento.html)
• Component model for transformations
• Concepts
• Domain specific language for bindings
• ATL transformations
metaDepth (http://metadepth.org)
• Multi-level textual modelling
• Integrated with the Epsilon languages (EOL, ETL, EGL)
• Concepts (structural and hybrid)
• Multi-level based reuse
• A-posteriori typing
BENTŌ
Adaptation of ATL transformations according to the binding
Support for refactoring meta-models into concepts
60
Sánchez Cuadrado, Guerra, de Lara. “A Component Model for Model Transformations”. IEEE TSE 2014
Sánchez Cuadrado, Guerra, de Lara. “Reusable Model Transformation Components with bentō”. ICMT’ 15
// Model
Tasks someTasks {
Task t0 {
start = "30/04/2015";
duration = 30;
name = "coding";
}
}
METADEPTH
61
Multi-level textual modelling
Concepts
• Over every Epsilon language
• Hybrid concepts
A-posteriori typing
• Over every Epsilon language
Analysis of type-level specs
• Integration with the USE validator
• Bidirectional reclassification
• Reclassification totality and surjectivity
// Meta-model
Model Tasks {
Node Task {
start : Date;
duration : int;
name : String;
}
}
CONCEPT-BASED
REUSE
62
concept SimpleTasks(&M,
&T,
&initial)
{
Model &M {
Node &T {
&initial : boolean;
name : String;
}
}
}
bind SimpleTasks(
SEProcess,
SEProcess::SETask,
SEProcess::SETask.isInitial
)
<<some operation>>
rule Task2Place
transform task : Source!&T
to place : Target!Place
{
place.name := task.name;
if (task.&initial=true)
place.tokens:=1
else
place.tokens:=0
}
ETL transformation
63
Model ProcessModel@2 {
Node Task {
name@1 : String[0..1];
initial : boolean = false;
}
}
ProcessModel SoftwareProcess {
Task Analysis {
name = “reqs, analysis”;
}
}
SoftwareProcess aSoftProcess{
Analysis a {
initial = true;
}
}
@model(potency=0)
rule Task2Place
transform task : Source!Task
to place : Target!Place
{
place.name := task.name;
if (task.initial=true)
place.tokens:=1
else
place.tokens:=0
}
ETL transformation
MULTI-LEVEL BASED
REUSE
A-POSTERIORI TYPING:
BX MODEL TRANSFORMATIONS
Simple bidirectional model transformations by reclassification
64
Simple bidirectional model transformations by reclassification
65
type Factory PetriNet {
Conveyor::parts > Place::tokens,
Generator::outps > Transition::outs, Terminator::inps > Transition::ins,
Assembler::inps > Transition::ins, Assembler::outps > Transition::outs,
}
A-POSTERIORI TYPING:
BX MODEL TRANSFORMATIONS
Simple bidirectional model transformations by reclassification
66
Forward reclassification
A-POSTERIORI TYPING:
BX MODEL TRANSFORMATIONS
Factory example { // 1st typing
Conveyor p {}
Terminator t { inps= [p]; }
}
Factory example { // 2nd typing
Conveyor p {}
Assembler t { inps= [p]; }
}
67
PetriNet example {
Place p {}
Transition t { ins = [p]; }
}
MetaDepth console
> dump example as Factory
The typing specification can also be used backwards!
Might yield multiple AP typings for a model
A-POSTERIORI TYPING:
BX MODEL TRANSFORMATIONS
// Model witness with no Petri net equivalent
Factory noRefinementWitness {
Assembler assembler2 { outps= [conveyor2, conveyor1]; }
Conveyor conveyor1 { name= "string1"; }
Conveyor conveyor2 { name= "string1"; }
Generator generator2 { outps= [conveyor1]; }
Part part2 {
qa = true;
} // This part would become a token outside any Place
}
68
The reclassification is not total
• Equivalently, the backwards reclassification is not surjective
The solver produces a witness
• A Factory model that cannot be reclassified into a Petri net
A-POSTERIORI TYPING:
BX MODEL TRANSFORMATIONS
APPLICATIONS:
REUSE OF OPERATIONS
Simulator for Petri nets can be reused “as is” for Factory
• Provide an AP typing from Factory to Petri nets
• Factory models become typed as Petri nets
69
// EOL excerpt of the simulator
operation Transition enabled() : Boolean {
return self.ins.forAll(p| p.tokens.size()>0);
}
operation step() : Boolean {
var enabled : Set(Transition) := Transition.all.select( t | t.enabled());
... // fire one random Transition from enabled
}
APPLICATIONS:
FLEXIBLE REUSE
70
// Type parts as tokens only if QA is passed
type Factory PetriNet inst {
$Conveyor.all$ > Place with {
/sp : Token[*] = $self.parts.select(p|p.qa=true)$ > tokens
}
$Part.all.select( p | p.qa = true )$ > Token
}
SUMMARY
Approaches to reuse in model transformation
• Reuse transformations for other meta-models
Concept-based
• Ideas from generic programming
• Hybrid concepts, adapters
Multi-level modelling
• Families of languages
A-posteriori typing
• Provide additional types via retyping specifications
• Dynamic typing
71
FUTURE WORK
72
Syntactic vs Semantic reuse correctness
• Transformation intents
Improve tool support for retypings and reuse
• Repositories of reusable transformations
• Reuse recommenders
Exploit structural typing in MDE
Explore multiple typings for MDE
Explore more in detail retypings as bx transformations
73
if you put water into a cup, it
becomes the cup
TAKE-HOME LESSON
74
if you put water into a cup, it
becomes the cup
you put water into a bottle, it
becomes the bottle
TAKE-HOME LESSON
75
if you put water into a cup, it
becomes the cup
you put water into a bottle, it
becomes the bottle
you put it in a teapot, it becomes
the teapot
TAKE-HOME LESSON
76
if you put water into a cup, it
becomes the cup
you put water into a bottle, it
becomes the bottle
you put it in a teapot, it becomes
the teapot
be like water my friend
Bruce Lee
77
if you put water into a cup, it
becomes the cup
you put water into a bottle, it
becomes the bottle
you put it in a teapot, it becomes
the teapot
(let transformations) be like water
my friendBruce Lee
THANKS!
Juan.deLara@uam.es
78
http://www.miso.es
joint work with
E. Guerra and J. Sánchez Cuadrado
@miso_uam

More Related Content

Viewers also liked

01.03.2013, NEWSWIRE, Issue 263
01.03.2013, NEWSWIRE, Issue 26301.03.2013, NEWSWIRE, Issue 263
01.03.2013, NEWSWIRE, Issue 263
The Business Council of Mongolia
 
Hombre
HombreHombre
Domin ocartel
Domin ocartelDomin ocartel
2nd International Conference on Inclusive Innovation and Innovative managemen...
2nd International Conference on Inclusive Innovation and Innovative managemen...2nd International Conference on Inclusive Innovation and Innovative managemen...
2nd International Conference on Inclusive Innovation and Innovative managemen...
Pramila (มีล่า) Shrestha
 
The Next Small Thing
The Next Small ThingThe Next Small Thing
The Next Small Thing
Mayank Mohan Upadhyay
 
Hvetjandi samtalstækni
Hvetjandi samtalstækni Hvetjandi samtalstækni
Hvetjandi samtalstækni
ingileif2507
 
Ус-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөө
Ус-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөөУс-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөө
Ус-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөө
Medimpex
 
Choosing a Persuasive Essay Topic
Choosing a Persuasive Essay TopicChoosing a Persuasive Essay Topic
Choosing a Persuasive Essay Topic
morag
 
'What's it like to be an app?' experience prototyping workshop -- the output
'What's it like to be an app?' experience prototyping workshop -- the output'What's it like to be an app?' experience prototyping workshop -- the output
'What's it like to be an app?' experience prototyping workshop -- the output
Made by Many
 
Rubén Darío
Rubén DaríoRubén Darío
project OS
project  OSproject  OS
project OS
Banan Hasan
 

Viewers also liked (11)

01.03.2013, NEWSWIRE, Issue 263
01.03.2013, NEWSWIRE, Issue 26301.03.2013, NEWSWIRE, Issue 263
01.03.2013, NEWSWIRE, Issue 263
 
Hombre
HombreHombre
Hombre
 
Domin ocartel
Domin ocartelDomin ocartel
Domin ocartel
 
2nd International Conference on Inclusive Innovation and Innovative managemen...
2nd International Conference on Inclusive Innovation and Innovative managemen...2nd International Conference on Inclusive Innovation and Innovative managemen...
2nd International Conference on Inclusive Innovation and Innovative managemen...
 
The Next Small Thing
The Next Small ThingThe Next Small Thing
The Next Small Thing
 
Hvetjandi samtalstækni
Hvetjandi samtalstækni Hvetjandi samtalstækni
Hvetjandi samtalstækni
 
Ус-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөө
Ус-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөөУс-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөө
Ус-давсны солилцооны зохицуулгад байгалийн гаралтай эрдэст бэлдмэлийн нөлөө
 
Choosing a Persuasive Essay Topic
Choosing a Persuasive Essay TopicChoosing a Persuasive Essay Topic
Choosing a Persuasive Essay Topic
 
'What's it like to be an app?' experience prototyping workshop -- the output
'What's it like to be an app?' experience prototyping workshop -- the output'What's it like to be an app?' experience prototyping workshop -- the output
'What's it like to be an app?' experience prototyping workshop -- the output
 
Rubén Darío
Rubén DaríoRubén Darío
Rubén Darío
 
project OS
project  OSproject  OS
project OS
 

Similar to Approaches to Model Transformation Reuse: from Concepts to A-posteriori typing

Model Transformation Reuse
Model Transformation ReuseModel Transformation Reuse
Model Transformation Reuse
miso_uam
 
Miso
MisoMiso
Miso
miso_uam
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGill
miso_uam
 
Rejunevating software reengineering processes
Rejunevating software reengineering processesRejunevating software reengineering processes
Rejunevating software reengineering processes
manishthaper
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional Programming
RichardWarburton
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - Warburton
Codemotion
 
Reviewing OOP Design patterns
Reviewing OOP Design patternsReviewing OOP Design patterns
Reviewing OOP Design patterns
Olivier Bacs
 
On the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling LanguagesOn the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling Languages
Jose E. Rivera
 
Determan SummerSim_submit_rev3
Determan SummerSim_submit_rev3Determan SummerSim_submit_rev3
Determan SummerSim_submit_rev3
John Determan
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
Abdalmassih Yakeen
 
PhD Thesis Presentation
PhD Thesis PresentationPhD Thesis Presentation
PhD Thesis Presentation
Lola Burgueño
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
jeffz
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Ovidiu Farauanu
 
A-posteriori typing for model-driven engineering
A-posteriori typing for model-driven engineeringA-posteriori typing for model-driven engineering
A-posteriori typing for model-driven engineering
miso_uam
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Marco Parenzan
 
Design for testability as a way to good coding (SOLID and IoC)
Design for testability as a way to good coding (SOLID and IoC)Design for testability as a way to good coding (SOLID and IoC)
Design for testability as a way to good coding (SOLID and IoC)
Simone Chiaretta
 
Situational Method Engineering
Situational Method EngineeringSituational Method Engineering
Situational Method Engineering
Anatoly Levenchuk
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
Daniel Egan
 
A Comparative Analysis of Task Modeling Notations
A Comparative Analysis of Task Modeling NotationsA Comparative Analysis of Task Modeling Notations
A Comparative Analysis of Task Modeling Notations
Juan Manuel Gonzalez Calleros
 
Aggregates, Entities and Value objects - Devnology 2010 community day
Aggregates, Entities and Value objects - Devnology 2010 community dayAggregates, Entities and Value objects - Devnology 2010 community day
Aggregates, Entities and Value objects - Devnology 2010 community day
Rick van der Arend
 

Similar to Approaches to Model Transformation Reuse: from Concepts to A-posteriori typing (20)

Model Transformation Reuse
Model Transformation ReuseModel Transformation Reuse
Model Transformation Reuse
 
Miso
MisoMiso
Miso
 
Miso-McGill
Miso-McGillMiso-McGill
Miso-McGill
 
Rejunevating software reengineering processes
Rejunevating software reengineering processesRejunevating software reengineering processes
Rejunevating software reengineering processes
 
Twins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional ProgrammingTwins: Object Oriented Programming and Functional Programming
Twins: Object Oriented Programming and Functional Programming
 
TWINS: OOP and FP - Warburton
TWINS: OOP and FP - WarburtonTWINS: OOP and FP - Warburton
TWINS: OOP and FP - Warburton
 
Reviewing OOP Design patterns
Reviewing OOP Design patternsReviewing OOP Design patterns
Reviewing OOP Design patterns
 
On the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling LanguagesOn the Semantics of Real-Time Domain Specific Modeling Languages
On the Semantics of Real-Time Domain Specific Modeling Languages
 
Determan SummerSim_submit_rev3
Determan SummerSim_submit_rev3Determan SummerSim_submit_rev3
Determan SummerSim_submit_rev3
 
MDE in Practice
MDE in PracticeMDE in Practice
MDE in Practice
 
PhD Thesis Presentation
PhD Thesis PresentationPhD Thesis Presentation
PhD Thesis Presentation
 
LINQ Inside
LINQ InsideLINQ Inside
LINQ Inside
 
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
Functional Patterns for C++ Multithreading (C++ Dev Meetup Iasi)
 
A-posteriori typing for model-driven engineering
A-posteriori typing for model-driven engineeringA-posteriori typing for model-driven engineering
A-posteriori typing for model-driven engineering
 
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
 
Design for testability as a way to good coding (SOLID and IoC)
Design for testability as a way to good coding (SOLID and IoC)Design for testability as a way to good coding (SOLID and IoC)
Design for testability as a way to good coding (SOLID and IoC)
 
Situational Method Engineering
Situational Method EngineeringSituational Method Engineering
Situational Method Engineering
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
A Comparative Analysis of Task Modeling Notations
A Comparative Analysis of Task Modeling NotationsA Comparative Analysis of Task Modeling Notations
A Comparative Analysis of Task Modeling Notations
 
Aggregates, Entities and Value objects - Devnology 2010 community day
Aggregates, Entities and Value objects - Devnology 2010 community dayAggregates, Entities and Value objects - Devnology 2010 community day
Aggregates, Entities and Value objects - Devnology 2010 community day
 

More from miso_uam

Model-driven engineering for AR
Model-driven engineering for ARModel-driven engineering for AR
Model-driven engineering for AR
miso_uam
 
Capone.pdf
Capone.pdfCapone.pdf
Capone.pdf
miso_uam
 
MLE_keynote.pdf
MLE_keynote.pdfMLE_keynote.pdf
MLE_keynote.pdf
miso_uam
 
Multi21
Multi21Multi21
Multi21
miso_uam
 
MLMPLs
MLMPLsMLMPLs
MLMPLs
miso_uam
 
Scientific writing
Scientific writingScientific writing
Scientific writing
miso_uam
 
Facets_UCM
Facets_UCMFacets_UCM
Facets_UCM
miso_uam
 
SLE_MIP08
SLE_MIP08SLE_MIP08
SLE_MIP08
miso_uam
 
mtATL
mtATLmtATL
mtATL
miso_uam
 
Máster en Métodos Formales en Ingeniería Informática
Máster en Métodos Formales en Ingeniería InformáticaMáster en Métodos Formales en Ingeniería Informática
Máster en Métodos Formales en Ingeniería Informática
miso_uam
 
Analysing-MMPLs
Analysing-MMPLsAnalysing-MMPLs
Analysing-MMPLs
miso_uam
 
Facets
FacetsFacets
Facets
miso_uam
 
kite
kitekite
kite
miso_uam
 
MTPLs
MTPLsMTPLs
MTPLs
miso_uam
 
DSLcomet
DSLcometDSLcomet
DSLcomet
miso_uam
 
SICOMORO
SICOMOROSICOMORO
SICOMORO
miso_uam
 
ReusingMT
ReusingMTReusingMT
ReusingMT
miso_uam
 
MDE-experiments
MDE-experimentsMDE-experiments
MDE-experiments
miso_uam
 
keynote modelsward 2017
keynote modelsward 2017keynote modelsward 2017
keynote modelsward 2017
miso_uam
 
MODELSWARD 2017 Panel
MODELSWARD 2017 PanelMODELSWARD 2017 Panel
MODELSWARD 2017 Panel
miso_uam
 

More from miso_uam (20)

Model-driven engineering for AR
Model-driven engineering for ARModel-driven engineering for AR
Model-driven engineering for AR
 
Capone.pdf
Capone.pdfCapone.pdf
Capone.pdf
 
MLE_keynote.pdf
MLE_keynote.pdfMLE_keynote.pdf
MLE_keynote.pdf
 
Multi21
Multi21Multi21
Multi21
 
MLMPLs
MLMPLsMLMPLs
MLMPLs
 
Scientific writing
Scientific writingScientific writing
Scientific writing
 
Facets_UCM
Facets_UCMFacets_UCM
Facets_UCM
 
SLE_MIP08
SLE_MIP08SLE_MIP08
SLE_MIP08
 
mtATL
mtATLmtATL
mtATL
 
Máster en Métodos Formales en Ingeniería Informática
Máster en Métodos Formales en Ingeniería InformáticaMáster en Métodos Formales en Ingeniería Informática
Máster en Métodos Formales en Ingeniería Informática
 
Analysing-MMPLs
Analysing-MMPLsAnalysing-MMPLs
Analysing-MMPLs
 
Facets
FacetsFacets
Facets
 
kite
kitekite
kite
 
MTPLs
MTPLsMTPLs
MTPLs
 
DSLcomet
DSLcometDSLcomet
DSLcomet
 
SICOMORO
SICOMOROSICOMORO
SICOMORO
 
ReusingMT
ReusingMTReusingMT
ReusingMT
 
MDE-experiments
MDE-experimentsMDE-experiments
MDE-experiments
 
keynote modelsward 2017
keynote modelsward 2017keynote modelsward 2017
keynote modelsward 2017
 
MODELSWARD 2017 Panel
MODELSWARD 2017 PanelMODELSWARD 2017 Panel
MODELSWARD 2017 Panel
 

Recently uploaded

14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
Luigi Fugaro
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
Envertis Software Solutions
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
anfaltahir1010
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 

Recently uploaded (20)

14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
What’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete RoadmapWhat’s New in Odoo 17 – A Complete Roadmap
What’s New in Odoo 17 – A Complete Roadmap
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLESINTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
INTRODUCTION TO AI CLASSICAL THEORY TARGETED EXAMPLES
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 

Approaches to Model Transformation Reuse: from Concepts to A-posteriori typing

  • 1. APPROACHES TO MODEL TRANSFORMATION REUSE ICMT’2016, Viena Juan de Lara joint work with Esther Guerra and Jesús Sánchez Cuadrado Modelling&Software Engineering Research Group http://miso.es @miso_uam
  • 2. FROM CONCEPTS TO A-POSTERIORI TYPING Juan de Lara joint work with Esther Guerra and Jesús Sánchez Cuadrado Modelling&Software Engineering Research Group http://miso.es @miso_uam ICMT’2016, Viena
  • 3. Model-transformations are the key elements for automation in model-based approaches MOTIVATION 3 Domain-specific languages Proliferation of domain meta-models
  • 4. MOTIVATION 4 Transformations are defined over specific meta-models Difficult to reuse for other related meta-models How to avoid creating (essentially) the same transformation for different meta-models?
  • 5. MOTIVATION: PROCESS MODELS TO PETRI NETS 5 Task name: String initial: boolean next * Place Transitionid: String tokens: int inps outs * *
  • 6. 6 press wait cross start start press wait cross Task name: String initial: boolean next * Place Transitionid: String tokens: int inps outs * * MOTIVATION: PROCESS MODELS TO PETRI NETS task2PN
  • 8. 8 TRANSFORMATION (ATL) rule Task2Place { from t : Process!Task to p : PN!Place ( id <- t.name, tokens <- if t.initial then 1 else 0 endif ) } rule next2Transition { from t1 : Process!Task, t2 : Process!Task (t1.next->includes(t2)) to tr : PN!Transition ( inps <- t1, outs <- t2 ) } …
  • 9. REUSE FOR ANOTHER META-MODEL 9 Task name: String initial: boolean next * Place Transitionid: String tokens: int inps outs * * Activity ident: String InitialActivity task2PN FlowEdge from to
  • 10. 10 rule Task2Place { from t : Process!Task to p : PN!Place ( id <- t.name, tokens <- if t.initial then 1 else 0 endif ) } rule next2Transition { from t1 : Process!Task, t2 : Process!Task (t1.next->includes(t2)) to tr : PN!Transition ( inps <- t1, outs <- t2 ) } … AD-HOC REUSE (COPY+ADAPT)
  • 11. AD-HOC REUSE (COPY+ADAPT) 11 rule Task2Place { from t : Process!Activity to p : PN!Place ( id <- t.ident, tokens <- if t.oclIsTypeOf(Process!InitialActivity) then 1 else 0 endif ) } rule next2Transition { from t1 : Process!Activity, t2 : Process!Activity (Process!FlowEdge.allInstances()->exist(e | e.from=t1 and e.to=t2)) to tr : PN!Transition ( inps <- t1, outs <- t2 ) }
  • 12. AD-HOC REUSE (COPY+ADAPT) 12 rule Task2Place { from t : Process!Activity to p : PN!Place ( name <- t.ident, tokens <- if t.oclIsTypeOf(Process!InitialActivity) then 1 else 0 endif ) } rule next2Transition { from t1 : Process!Activity, t2 : Process!Activity (Process!FlowEdge.allInstances()->exist(e | e.from=t1 and e.to=t2)) to tr : PN!Transition ( inps <- t1, outs <- t2 ) } • Complex and error prone • Repetitive • Does not scale to large transformations
  • 13. EXPLICIT MODEL ADAPTATION 1313 Task name: String initial: boolean next * Place Transitionid: String tokens: int inps outs * * Activity ident: String InitialActivity task2PN FlowEdge from to activity2task;task2PN activity2task
  • 14. MOTIVATION 14 rule Activity2Task { from t : Activities!Activity to p : Process!Task ( id <- t.ident, initial <- t.oclIsKindOf(Activities!InitialActivity), next <- Activities!FlowEdge.allInstances()-> select (e | e.from = t)-> collect(e | e.to ) ) } t: InitialActivity ident=“a0” p: Task name=“a0” initial=true pl: Place name=“a0” tokens=1 activity2task task2PN
  • 15. MOTIVATION 15 rule Activity2Task { from t : Activities!Activity to p : Process!Task ( name <- t.ident, initial <- t.oclIsKindOf(Activities!InitialActivity), next <- Activities!FlowEdge.allInstances()-> select (e | e.from = t)-> collect(e | e.to ) ) } • Three models involved, complicates traceability • Two transformations: less efficient • May require a transformation back to the initial model
  • 16. Concept-based reuse de Lara, Guerra. “From types to type requirements: genericity for model-driven engineering”. SoSyM 2103. Sánchez Cuadrado, Guerra, de Lara. “A Component Model for Model Transformations”. IEEE Trans. Software Eng. 2014. Multi-level based reuse de Lara, Guerra, Sánchez Cuadrado. “Model-driven engineering with domain specific meta-modelling languages”. SoSyM 2015. A-posteriori typing de Lara, Guerra, Sánchez Cuadrado. “A-posteriori typing for Model-Driven Engineering”. MoDELS 2015: 156-165 Transformation co-evolution Di Ruscio, Iovino, Pierantonio. “A Methodological Approach for the Coupled Evolution of Metamodels and ATL Transformations”. ICMT’13 Model (sub-)typing Steel, Jezequel. “On Model Typing”. SoSyM 2007. Guy, et al. “On Model Subtyping”. ECMFA'12. SO WHAT? 16
  • 17. Concept-based reuse de Lara, Guerra. “From types to type requirements: genericity for model-driven engineering”. SoSyM 2103. Sánchez Cuadrado, Guerra, de Lara. “A Component Model for Model Transformations”. IEEE Trans. Software Eng. 2014. Multi-level based reuse de Lara, Guerra, Sánchez Cuadrado. “Model-driven engineering with domain specific meta-modelling languages”. SoSyM 2015. A-posteriori typing de Lara, Guerra, Sánchez Cuadrado. “A-posteriori typing for Model-Driven Engineering”. MoDELS 2015: 156-165 Transformation co-evolution Di Ruscio, Iovino, Pierantonio. “A Methodological Approach for the Coupled Evolution of Metamodels and ATL Transformations”. ICMT’13 Model (sub-)typing Steel, Jezequel. “On Model Typing”. SoSyM 2007. Guy, et al. “On Model Subtyping”. ECMFA'12. SO WHAT? 17
  • 18. Automate ad-hoc copy-adaptation: CONCEPT-BASED REUSE 18 Concept Msrc Mtar from to «conforms to» «conforms to» Template execution MMsrc Instantiated template to binding MMtar HOT Transformation template definition from Final user Transformation developer (with reuse) Transformation developer (for reuse) 1 2 3 4 • Transformations defined over “concepts” • Binding to concrete meta-model • Automated transformation adaptation
  • 19. 19 STRUCTURAL CONCEPTS Structural Concepts. • They gather the structure needed from meta-models for the transformation to be applicable. • They have the form of a meta- model as well. SimpleTask concept Task name: String initial: boolean next * Their elements are treated as variables, which need to be bound to elements in specific meta-models. Interface of the transformation • No superflous elements • No extra complexity • Transformations become as simple as possible
  • 20. 20 REUSABLE TRANSFORMATIONS Transformations defined using the types of the concept. L R=NAC t:Task name=n t:Task name=n :Place id=n tokens=t.initial?1:0 t1:Task t2:Task :next p1:Place p2:Place t1:Task t2:Task :next p1:Place p2:Place :Transition :inps :outs L R=NAC
  • 21. 21 BINDING Concept binding: • Bind each element in the concept to an element in the meta-model. Task SETask name  id initial  isInitial next  following Binding SETaskEngineer Coding Testing actors * Software Engineering processes Design SimpleTask concept Task name: String initial: boolean next * Analysis id: String isInitial: boolean following 0..5
  • 22. ADAPTATION The transformation gets automatically adapted Similar to template instantiation in generic programming 22 t:SETask id=n t:SETask id=n :Place id=n tokens=t.isInitial?1:0 t1:SETask t2:SETask :following p1:Place p2:Place t1:SETask t2:SETask :following p1:Place p2:Place :Transition :inps :outs
  • 23. WAIT A MOMENT… IS THE RESULTING TRANSFORMATION CORRECT? Rules for the binding • Cardinalities • Composition, features, subtyping, etc Depends on what you do with the concept • Read only (e.g., for M2M transformation) • Write (e.g., for in-place transformation) 23 SETaskTask SETaskTask Concept Meta-modelbinding R W Sánchez Cuadrado, Guerra, de Lara. “Flexible Model-to-Model Transformation Templates: An Application to ATL”. JOT 2012. Task next * SETask R following 0..5 SETask following 0..5 Task next * W
  • 24. WAIT A MOMENT… ISN’T THIS JUST A RENAMING? HOW FLEXIBLE IS THE BINDING? Basic binding • Renaming of types, attributes • N-to-1 mappings More flexibility is needed in practice • Hybrid concepts • Cardinalities in concept elements • Adapters 24
  • 25. 25 MORE FLEXIBLE BINDINGS Concepts express a particular design choice on how structure is organized Different meta-models may implement the same structure differently • Association as intermediate class • Enumerate as subclases • etc. binding Task name: String initial: boolean next * Activity ident: String InitialActivity FlowEdge from to
  • 26. 26 HYBRID CONCEPTS Hide “unessential” structure behind required operations Operations need to be implemented together with the binding The generic transformation may use these required operations Task getName(): String isInitial():boolean getNext(): Task[*] SimpleTask hybrid concept
  • 27. 27 HYBRID CONCEPTS operation Activity getName() : String { return self.ident } operation Activity isInitial() : boolean { return false; } operation Activity getNext() : Set(Activity) { return FlowEdge.all.select(f|f.from=self).collect(f|f.to); } operation InitialActivity isInitial() : boolean { return true;} Task  Activity binding
  • 28. 28 HYBRID CONCEPTS operation Activity getName() : String { return self.ident } operation Activity isInitial() : boolean { return false; } operation Activity getNext() : Set(Activity) { return FlowEdge.all.select(f|f.from=self).collect(f|f.to); } operation InitialActivity isInitial() : boolean { return true;} Task  Activity binding Allows bridging a large number of heterogeneities The generic transformation needs to be written using these operations. Difficult for e.g. graph transformation approaches
  • 29. 29 BINDING ADAPTERS Elements in the concept are variables • Allow binding them to expressions: adapters Adapters resolve the heterogeneities between the concept and the meta-model They induce an adaptation of the transformation
  • 30. rule Task2Place { from t : Pr!Task to p : PN!Place ( tokens <- if t.initial then 1 else 0 endif )} 30 Task initial: boolean next * Concept Activity InitialActivity Flow Edge from to Task  Activity Task.initial  if (self.oclIsKindOf(InitialActivity)) then true else false endif Task.next  FlowEdge.allInstances()-> select(e|e.from=self)-> collect(to) Meta-model typed on helper context Pr!Activity def: initial : Boolean = if (…) then true else false endif; rule Task2Place { from t : Pr!Activity to p : PN!Place ( tokens <- if t.initial then 1 else 0 endif )} typed on adaptation
  • 31. 31 ADAPTERS VS HYBRID CONCEPTS Bridge a large number of heterogeneities The generic transformation remains agnostic w.r.t. the binding Adaptation mechanism dependent on the particular transformation language (e.g., ATL) Bridge a large number of heterogeneities The generic transformation needs to be written using operations Adaptation mechanism dependent on the particular transformation language (e.g., Epsilon) Hybrid concepts Adapters
  • 32. WAIT A MOMENT… Aren’t concepts characterizing a set of “suitable” meta-models for the transformation? Isn’t that exactly what meta-models do (for models)? Concepts as meta-meta-models Rely on typing: no need to adapt the transformation 32
  • 33. Language families as instances of a common meta-model MULTI-LEVEL BASED REUSE 33 Process Modelling Software Process Modelling Language Educational Modelling Language Software Process Models Educational Models
  • 34. 34 MULTI-LEVEL BASED GENERICITY Transformations can be defined at the top meta-level Applicable to instances of all languages in the family Process Modelling Software Process Modelling Language Educational Modelling Language Software Process Models Educational Models … Transformation defined on applicableto
  • 35. 35 MULTI-LEVEL BASED GENERICITY Task Kind Gateway Kind Seq Par src tar * * Test: TaskKindCoding:TaskKind T2C: Seq C2T: Seq src tar srctar data: Coding unitDt: Test gui: Coding : C2T src tar : T2C tar src «conf» «conf» data: Coding unitDT: Test gui: Coding rule Task2Place transform t : Level0!TaskKind to p : Place { ... } .... defined on
  • 36. rule Task2Place transform t : Level0!TaskKind to p : Place { ... } .... 36 MULTI-LEVEL BASED GENERICITY data: Coding unitDT: Test gui: Coding rule Coding2Place transform t : Coding to p : Place {…} rule Test2Place transform t : Test to p : Place {…} defined on data: Coding unitDt: Test gui: Coding : C2T src tar : T2C tar src «conf» Task Kind Gateway Kind Seq Par src tar * * Test: TaskKindCoding:TaskKind T2C: Seq C2T: Seq src tar srctar «conf»
  • 37. 37 MULTI-LEVEL VS CONCEPT- BASED GENERICITY Concept-based Genericity Multi-level-based Genericity • A posteriori binding: meta- models may exist first. • Adapters and hybrid concepts to solve heterogeneities. • A priori: meta-meta-model should exist first. • Ability to apply an operation several meta-levels below. • Domain-Specific meta- modelling.
  • 38. 38 CAN WE GET THE BEST OF BOTH APPROACHES? • A posteriori binding: meta-models may exist first. • Adapters or Hybrid concepts to solve heterogeneities. • Independence of the transformation language Concept-based reuse Multi-level reuse
  • 39. 39 CAN WE GET THE BEST OF BOTH APPROACHES? • A posteriori binding: meta-models may exist first. • Adapters to solve heterogeneities. • Independence of the transformation language Concept-based reuse Multi-level reuse Let’s make the typing relation: • A-posteriori • As flexible as adapters
  • 40. A-POSTERIORI TYPING 40 A more flexible typing mechanism for MDE Decouple instantiation from classification • Interfaces in object-oriented programming • Roles in role-based programming languages Allow dynamic typing and multiple classifiers for objects Type and instance-level reclassification specifications
  • 41. CONSTRUCTIVE VS A-POSTERIORI TYPING 41 Task start: Date duration: int name: String review: Task start= 8/5/15 duration= 30 name= “rev” creation «instance of» Measurable quantity: int Schedulable date: Date review: Task Tasks meta-model model Scheduling MM Measuring MM model «instance of» «instance of» start= 8/5/15 duration= 30 name= “rev” «Schedulable,Measurable» Constructive typing A-posteriori typing Constructive typing A-posteriori typing
  • 42. 42 *topics * * res Task start: Date duration: int name: String Tasks meta-model (constructive types) Resource Person owner assigned 1..* 1..* 0..3 reviewsArticle title: String Conference meta-model (dynamic types) Reviewer Authorauthors Topic desc: String «Author» p2: Person «Reviewer» p1: Person «Article» r: Resource :owner t1:Task start: 8/5/15 duration: 30 name: “rev” :res :assigned «Author,Reviewer» p2: Person «Reviewer» p1: Person «Article» r: Resource :owner t1:Task start: 8/5/15 duration: 30 name: “rev” :res :assigned «Author» p3: Person «Article» s: Resource :owner t2:Task start: 9/5/15 duration: 30 name: “rev” :res :assigned the model changes and gets retyped creation «instance of» model • A Person (constructive type) is only a Reviewer (a posteriori type) when some condition is met. A-POSTERIORI TYPING: FLEXIBLE REUSE
  • 43. SPECIFYING AP TYPINGS AT THE TYPE-LEVEL 43 Schedulable date: Date span: double review: Task Tasks meta-model ( MMC ) start= 8/5/15 /months= 1 duration= 30 name= “rev” Scheduling MM ( MMR ) Task start: Date duration: int name: String Typing Specification Task  Schedulable self.start  date /months: double=self.duration/30  span «Schedulable» «date» «span» creation «instance of» (constructive) «instance of» (a-posteriori) • Derived attributes (months) defined in the typing specification. • Typing rules: ensure syntactic correctness
  • 44. TYPE-LEVEL AP TYPING 44 date: Date span: double writing: Task start= 15/3/15 duration= 90 name= “wrt” review: Task start= 8/5/15 duration= 30 name= “rev” Schedulable Scheduling MM (MMR) Instance model of Tasks ( MMC ) «instance of» (a-posteriori) “Scheduling glasses” Operations review: Schedulable date= 8/5/15 span= 1 {review, writing} {1, 3} Schedulable.allInstances() writing: Schedulable date= 15/3/15 span= 3 Schedulable.allInstances()-> collect(span)
  • 45. SPECIFYING AP TYPINGS AT THE INSTANCE LEVEL 45 date: Date span: double writing: Task start= 15/3/15 duration= 90 name= “wrt” review: Task start= 8/5/15 /months= 1 duration= 30 name= “rev” «Schedulable» «date» «instance of» (a-posteriori) Schedulable Scheduling MM (MMR) Typing Specification Task.allInstances()->select(duration<80)  Schedulable self.start  date /months: double=self.duration/30  span Instance model of Tasks ( MMC ) «span» • Typing defined by queries. • Derived attributes defined by queries as well.
  • 46. INSTANCE-LEVEL AP TYPING 46 Operations date: Date span: double writing: Task start= 15/3/15 duration= 90 name= “wrt” review: Task start= 8/5/15 duration= 30 name= “rev” Schedulable Scheduling MM (MMR) Instance model of Tasks ( MMC ) «instance of» (a-posteriori) review: Schedulable date= 8/5/15 span= 1 Schedulable.allInstances()-> collect(span) {review} {1} Schedulable.allInstances() “Scheduling glasses”
  • 47. INSTANCE-LEVEL AP TYPING 47 Operations date: Date span: double writing: Task start= 15/3/15 duration= 60 name= “wrt” review: Task start= 8/5/15 duration= 30 name= “rev” Schedulable Scheduling MM (MMR) Instance model of Tasks ( MMC ) «instance of» (a-posteriori) review: Schedulable date= 8/5/15 span= 1 Schedulable.allInstances()-> collect(span) {review, writing} {1, 2} Schedulable.allInstances() “Scheduling glasses” writing: Schedulable date= 15/3/15 span= 2
  • 48. Activity  Task ident  name /init : boolean = self.oclsKindOf(InitialActivity)  initial /follow: Task[*] = FlowEdge.allInstances()-> select(e|e.from=self)-> collect(e|e.to)  next EXAMPLE 48 Task name: String initial: boolean next * Activity ident: String InitialActivity FlowEdge from to
  • 49. Aren’t retypings now a kind of transformation? Producing a view of a given model How expressive are retypings considered as model transformations? 49 WAIT A MOMENT…
  • 50. A-POSTERIORI TYPING AS A TRANSFORMATION 50 Task name: String initial: boolean next Place Transitionid: String tokens: int inps outs * * task2PN Task.allInstances()  Place name  id /toks : int = if (self.initial) then 1 else 0  tokens Task.allInstances()->select(t|t.next.isDefined())  Transition /prevs : Task[*] = Set{self}  inps /nexts : Task[*] = Set{self.next}  outs 0..1
  • 51. A-POSTERIORI TYPING AS A TRANSFORMATION 51 Place Transitionid: String tokens: int inps outs * * t1:Task name=“t1” initial=false name=“t2” initial=true :next name=“t3” initial=false :next t2:Task t3:Task Task name: String initial: boolean next 0..1 task2PN
  • 52. A-POSTERIORI TYPING AS A TRANSFORMATION 52 Place Transitionid: String tokens: int inps outs * * «Place» «Place, Transition» «Place, Transition» «id» «id» «id» Task name: String initial: boolean next 0..1 task2PN t1:Task name=“t1” initial=false name=“t2” initial=true :next name=“t3” initial=false :next t2:Task t3:Task
  • 53. A-POSTERIORI TYPING AS A TRANSFORMATION 53 Place Transitionid: String tokens: int inps outs * * t2:Task t3:Task «Transition» «Transition» «outs» «outs» «inps» «inps» Task name: String initial: boolean next 0..1 task2PN «Place» «Place» «id» «id»name=“t2” initial=true name=“t3” initial=false t2:Task t3:Task «Place» «id» t1:Task name=“t1” initial=false
  • 54. TYPING AS TRANSFORMATION: THE GOOD 54 No objects need to be created • Just retype existing elements Incrementality (forwards) • For free Bidirectionality • For restricted cases of type-level specifications • Incrementality (backwards) for (more) restricted cases Analysis • Executability • Totality • Surjectivity
  • 55. 55 Limited expressivity • 1-to-1 or N-to-1 mappings • 1-to-N and N-to-M only in certain cases No replacement for regular transformation languages • Helpers, auxiliary operations, etc Efficiency operations for instance-level specifications • T.allInstances() needs to compute all objects belonging to T • Type caches and “smart” update policies TYPING AS TRANSFORMATION: THE BAD
  • 56. ANALYSIS OF A-POSTERIORI RETYPING 56 Schedulable date: Date span: double Tasks meta-model ( MMC ) Scheduling MM ( MMR ) Task start: Date duration: int name: String Typing Specification Task  Schedulable self.start  date /months: double=self.duration/30  span • Creation and role meta-models may have OCL constraints. • Executability: Can some “Tasks” models become valid Scheduling models?. • Totality: Can all Tasks models become valid Scheduling model?. • Surjectivity: Can every Scheduling instance be obtained via retyping some Tasks instance? CR0: self. span>0 CC0: self. duration<100
  • 57. 57 SO WHAT? WHAT HAVE WE GAINED? • The transformation is adapted • Adapters to solve heterogeneities • Automate ad-hoc reuse • Language families • Independence of the transformation language • Transformation applicable across levels Concept-based reuse Multi-level reuse • Independence of the transformation language • Heterogeneities can be resolved • Typing becomes dynamic and multiple • Improve model-adaptation-based reuse Retyping-based reuse
  • 59. TOOL SUPPORT 59 bentō (http://www.miso.es/tools/bento.html) • Component model for transformations • Concepts • Domain specific language for bindings • ATL transformations metaDepth (http://metadepth.org) • Multi-level textual modelling • Integrated with the Epsilon languages (EOL, ETL, EGL) • Concepts (structural and hybrid) • Multi-level based reuse • A-posteriori typing
  • 60. BENTŌ Adaptation of ATL transformations according to the binding Support for refactoring meta-models into concepts 60 Sánchez Cuadrado, Guerra, de Lara. “A Component Model for Model Transformations”. IEEE TSE 2014 Sánchez Cuadrado, Guerra, de Lara. “Reusable Model Transformation Components with bentō”. ICMT’ 15
  • 61. // Model Tasks someTasks { Task t0 { start = "30/04/2015"; duration = 30; name = "coding"; } } METADEPTH 61 Multi-level textual modelling Concepts • Over every Epsilon language • Hybrid concepts A-posteriori typing • Over every Epsilon language Analysis of type-level specs • Integration with the USE validator • Bidirectional reclassification • Reclassification totality and surjectivity // Meta-model Model Tasks { Node Task { start : Date; duration : int; name : String; } }
  • 62. CONCEPT-BASED REUSE 62 concept SimpleTasks(&M, &T, &initial) { Model &M { Node &T { &initial : boolean; name : String; } } } bind SimpleTasks( SEProcess, SEProcess::SETask, SEProcess::SETask.isInitial ) <<some operation>> rule Task2Place transform task : Source!&T to place : Target!Place { place.name := task.name; if (task.&initial=true) place.tokens:=1 else place.tokens:=0 } ETL transformation
  • 63. 63 Model ProcessModel@2 { Node Task { name@1 : String[0..1]; initial : boolean = false; } } ProcessModel SoftwareProcess { Task Analysis { name = “reqs, analysis”; } } SoftwareProcess aSoftProcess{ Analysis a { initial = true; } } @model(potency=0) rule Task2Place transform task : Source!Task to place : Target!Place { place.name := task.name; if (task.initial=true) place.tokens:=1 else place.tokens:=0 } ETL transformation MULTI-LEVEL BASED REUSE
  • 64. A-POSTERIORI TYPING: BX MODEL TRANSFORMATIONS Simple bidirectional model transformations by reclassification 64
  • 65. Simple bidirectional model transformations by reclassification 65 type Factory PetriNet { Conveyor::parts > Place::tokens, Generator::outps > Transition::outs, Terminator::inps > Transition::ins, Assembler::inps > Transition::ins, Assembler::outps > Transition::outs, } A-POSTERIORI TYPING: BX MODEL TRANSFORMATIONS
  • 66. Simple bidirectional model transformations by reclassification 66 Forward reclassification A-POSTERIORI TYPING: BX MODEL TRANSFORMATIONS
  • 67. Factory example { // 1st typing Conveyor p {} Terminator t { inps= [p]; } } Factory example { // 2nd typing Conveyor p {} Assembler t { inps= [p]; } } 67 PetriNet example { Place p {} Transition t { ins = [p]; } } MetaDepth console > dump example as Factory The typing specification can also be used backwards! Might yield multiple AP typings for a model A-POSTERIORI TYPING: BX MODEL TRANSFORMATIONS
  • 68. // Model witness with no Petri net equivalent Factory noRefinementWitness { Assembler assembler2 { outps= [conveyor2, conveyor1]; } Conveyor conveyor1 { name= "string1"; } Conveyor conveyor2 { name= "string1"; } Generator generator2 { outps= [conveyor1]; } Part part2 { qa = true; } // This part would become a token outside any Place } 68 The reclassification is not total • Equivalently, the backwards reclassification is not surjective The solver produces a witness • A Factory model that cannot be reclassified into a Petri net A-POSTERIORI TYPING: BX MODEL TRANSFORMATIONS
  • 69. APPLICATIONS: REUSE OF OPERATIONS Simulator for Petri nets can be reused “as is” for Factory • Provide an AP typing from Factory to Petri nets • Factory models become typed as Petri nets 69 // EOL excerpt of the simulator operation Transition enabled() : Boolean { return self.ins.forAll(p| p.tokens.size()>0); } operation step() : Boolean { var enabled : Set(Transition) := Transition.all.select( t | t.enabled()); ... // fire one random Transition from enabled }
  • 70. APPLICATIONS: FLEXIBLE REUSE 70 // Type parts as tokens only if QA is passed type Factory PetriNet inst { $Conveyor.all$ > Place with { /sp : Token[*] = $self.parts.select(p|p.qa=true)$ > tokens } $Part.all.select( p | p.qa = true )$ > Token }
  • 71. SUMMARY Approaches to reuse in model transformation • Reuse transformations for other meta-models Concept-based • Ideas from generic programming • Hybrid concepts, adapters Multi-level modelling • Families of languages A-posteriori typing • Provide additional types via retyping specifications • Dynamic typing 71
  • 72. FUTURE WORK 72 Syntactic vs Semantic reuse correctness • Transformation intents Improve tool support for retypings and reuse • Repositories of reusable transformations • Reuse recommenders Exploit structural typing in MDE Explore multiple typings for MDE Explore more in detail retypings as bx transformations
  • 73. 73 if you put water into a cup, it becomes the cup TAKE-HOME LESSON
  • 74. 74 if you put water into a cup, it becomes the cup you put water into a bottle, it becomes the bottle TAKE-HOME LESSON
  • 75. 75 if you put water into a cup, it becomes the cup you put water into a bottle, it becomes the bottle you put it in a teapot, it becomes the teapot TAKE-HOME LESSON
  • 76. 76 if you put water into a cup, it becomes the cup you put water into a bottle, it becomes the bottle you put it in a teapot, it becomes the teapot be like water my friend Bruce Lee
  • 77. 77 if you put water into a cup, it becomes the cup you put water into a bottle, it becomes the bottle you put it in a teapot, it becomes the teapot (let transformations) be like water my friendBruce Lee
  • 78. THANKS! Juan.deLara@uam.es 78 http://www.miso.es joint work with E. Guerra and J. Sánchez Cuadrado @miso_uam