61
From State- to Delta-based Bidirectional Transformations (BXs) Yingfei Xiong University of Waterloo 2011

From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

From State- to Delta-based

Bidirectional Transformations (BXs)

Yingfei Xiong

University of Waterloo

2011

Page 2: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 3: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 4: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

The Problem of Data Interchange

• Tom uses Firefox at home, storing a lot of

bookmarks

Page 5: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

The Problem of Data Interchange

• While in Tom’s office the boss requires

everyone to use Internet Explorer

Bill Gates is my brother!

Use IE or be fired!

Page 6: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

The Problem of Data Interchange

• So Tom copies the bookmark files from

Firefox directory to IE directory

Page 7: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Why the problem

• Data sharing the same information are

stored in different formats

Page 8: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Difficulties in Converting

Formats• Data may be stored in a binary format

which is rather complex.

– First 10 bytes is the title following a varying

string ended with 0xFFFF

• May be encrypted or indexed.

• Such a format may be a secret to the

company.Wanna know the

bookmark format of IE? I won’t tell you.

Page 9: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Intermediate Format

• Export to some intermediate format that is

easy to read and process

• Text files and CSV files

– Lack of structure information

– Lack of general operations to cope with data

IE Text Bookmark

Firefox TextBookmark

Convert

Page 10: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Standards for Data Interchange

• A standard for data interchange that

– Provides a generic data structure to describe

data

– Defines how the data are stored into and

loaded from files

– Provides a set of general APIs to operate data

• Two Standards

– W3C XML

– OMG MOF

Page 11: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

XML and MOF

• XML

– Proposed by W3C

– Based on the tree data structure

– Widely used in general area

• MOF

– Proposed by OMG

– Based on the object data structure

– Originated from Unified Modeling Language

– Intensively used in software engineering area

IE Bookmark MOF Model

Firefox BookmarkMOF Model

Convert

Page 12: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

A Possible IE Model

:Directory

Name = “Search Engines”

:Item

Name = “Google”Addr=“www.google.com”HotKey = “Ctrl + Alt + G”

:Item

Name = “Yahoo”Addr=“www.yahoo.co.jp”

HotKey = null

objects

attributes

referencesowner owner

Page 13: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

A Possible Firefox Model

:Folder

Name = “Search Engines”Description = “”

:Page

Name = “Google”URL=www.google.com

Desc=Search Engine

:Page

Name = “Yahoo”URL=www.yahoo.co.jpDesc=Yahoo Japan Site

:Rss

Name = “Yahoo News”URL=“news.yahoo.com/feed.rss”

Two models are still in different format.

Owner

Owner

:Folder

Name = “News”Description = “rss feeds”

Owner

Page 14: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

– XML and MOF

– Transformation Languages

– Bijective Transformations

– Bidirectional Transformations

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 15: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Transformation Languages

• Common tasks in format conversion

– Load and store files

– Locate to certain objects

– Read attributes

– …

• Tedious and error-prone

• Solution: Dedicated Languages for

Transformation

Page 16: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Transformation Languages

• Transformation

Languages on XML

– XSLT

– XQuery

• Transformation

Languages on MOF

– QVT

– ATL

An ATL Transformation:

rule Folder2Directory {

from f : Firefox!Folder

to d : IE!Directory {

Name <- f.Name

}

}

rule Page2Item {

from p : Firefox!Page

to i : IE!Item{

Name <- p.Name

Addr <- p.URL

Owner <- p.Owner

}

}

Page 17: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

– XML and MOF

– Transformation Languages

– Bijective Transformations

– Bidirectional Transformations

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 18: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

The Backward Transformation Problem

• What if another guy Jerry wants to transform IE Bookmarks into FireFox?

Page 19: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

The Simple Solution

FireFox to IE Transformation:

rule Folder2Directory {

from f : Firefox!Folder

to d : IE!Directory {

Name <- f.Name

}

}

rule Page2Item {

from p : Firefox!Page

to i : IE!Item{

Name <- p.Name,

Addr <- p.URL,

Owner <- p.Owner

}

}

IE to FireFox Transformation:

rule Directory2Folder {

from d : IE!Directory

to f : Firefox!Folder {

Name <- d.Name

}

}

rule Page2Item {

from i : IE!Item

to p : Firefox!Page {

Name <- i.Name,

URL <- i.Addr,

Owner <- i.Owner

}

}

The two transformations are very similar and contain duplicate information

Page 20: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Bijective Transformations

• Can we generate one transformation from

the other?

• The Bijective Transformation Languages

– Inv

– BOTL

• Use symmetric rules that can be executed

forwardly and backwardly

Page 21: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

– XML and MOF

– Transformation Languages

– Bijective Transformations

– Bidirectional Transformations

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 22: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

The Synchronization Problem

• What if Tom changes the IE bookmarks in his office?

transform

modify

transform

loss of Information

Page 23: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Bidirectional Transformations (BXs)

• If the one model is modified, how to reflect the

modifications back into the other model

• View Updating in Database

– When a view is modified, how to reflect the modifications

back into original databases

• Bidirectional Transformation Languages on trees

– Boomerang

– BiX

• Bidirectional Transformation Languages on graphs

– QVT

– TGG

Page 24: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

State-based BX

• Consistency Relation

– R:A×B

• Forward Propgation

– fPpg : A×A×B→B

• Backward Propagation

– bPpg : A×B×B→A

A

:bPpg

A

A’

B

B

B’

A’ B’

:fPpg

∈R

Page 25: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Example

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

25

:bPpg

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1’:Page

Name=GoogleURL=google.comDesc=Search English

Model Firefox’

p2’:Page

Name=Google CNURL=google.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=Google CNAddr=google.comHotkey=Alt+g

Page 26: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

BX subsumes Bijective

Transformations

:bPpg

A B

A B

:fPpg

○ ○

○○

Page 27: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Nothing is guaranteed

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

27

:bPpg

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1':Page

Name=GoogleURL=google.comDesc=Search English

Model Firefox’

p2’:Page

Name=Google CNURL=google.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=BaiduAddr=Baidu.comHotkey=Alt+b

Page 28: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Laws of BX: Consistency

A

:bPpg

A

A’

B

B

B’

A’ B’

:fPpg

∈R

∈R

∈R

∈R

Page 29: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Laws of BX: Identity Propagation

A

:bPpg

A

A

B

B

B

A B

:fPpg

Page 30: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

How to write BXs

• Write R, fPpg, bPpg, respectively

– Duplicated work

– Error-prone

Page 31: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Bidirectional Languages

Bidirectional

Program

Compile

fPpg bPpgR

Page 32: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Bidirectional Languages

Atomic BXs + Combinators

Page 33: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Atomic BX: filter[attr]

• R: Left – attr = Right

• Filter[HotKey].R

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE2

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

i2:Item

Name=GoogleAddr=google.com

Model IE2

i1:Item

Name=Google CNAddr=google.cn

Page 34: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Atomic BX: filter[Hotkey].fPpg

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE1

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

i2:Item

Name=GoogleAddr=google.com

Model IE2

i1:Item

Name=Google CNAddr=google.cn

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE1’

i1’:Item

Name=Google CNAddr=google.comHotkey=Alt+g

:filter[Hotkey].fPpg

i2’:Item

Name=GoogleAddr=google.com

Model IE2

i1’:Item

Name=Google CNAddr=google.com

Page 35: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Combinator: Sequential

Composition X;Y

• X.R is a function

• (X;Y).R=X.R;Y.R

• (X;Y).fPpg

A B

A’ B’

:A.fPpg

C

C’

:B.fPpg

:R

X;Y satisfies the

laws as long as X

and Y do

Page 36: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

An Example Program

filter[Hotkey];

renameAttribute[Addr, URL];

renameClass[Item, Page];

inverse[filter[Desc]]

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

Page 37: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 38: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Delta Interpretation 1

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

38

:bPpg

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1’:Page

Name=GoogleURL=google.comDesc=Search English

Model Firefox’

p2’:Page

Name=Google CNURL=google.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=Google CNAddr=google.comHotkey=Alt+g

p1=p1’p2=p2’

Page 39: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Delta Interpretation 2

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

39

:bPpg

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1’:Page

Name=GoogleURL=google.comDesc=Search English

Model Firefox’

p2’:Page

Name=Google CNURL=google.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=Google CNAddr=google.comHotkey=null

p1=p1’

Page 40: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Problem 1 of State-based BX

• Semantics of DD is mixed into DP,

complicating the latter

State-based fPpg

Delta

Propagation

Delta

DiscoveryModels Deltas

XModels

Delta

Discovery

Page 41: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Problem 2 of State-based BX

• New deltas are discarded, causing

composition problem

State-based fPpg

Delta

Propagation

Delta

DiscoveryModels Deltas

XModels

Delta

DiscoveryDeltas

Page 42: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

BA

A’ B’

:X.bPpgC

:Y.bPpg

C’

b1 b2

Erroneous Sequential Composition

Efficiency: X.bPpg has to compute the delta again

Semantics: X.bPpg may compute a different delta

Page 43: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

filter[Hotkey]; filter[Addr]

Model IE1

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

Model IE1’

i1’:Item

Name=谷歌中国Addr=google.cnHotkey=null

Model IE2

i1:Item

Name=Google CNAddr=google.cn

Model IE3

i1:Item

Name=Google CN

Model IE2’

i1’:Item

Name=谷歌中国Addr=google.cn

Model IE3’

i1’:Item

Name=谷歌中国

:filter[Hotkey].bPpg :filter[Addr].bPpgi1=i1’i1≠i1’

Page 44: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Horizontal Delta Interpretation 1

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

44

i1:Item

Name=Google CNAddr=google.comHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1’:Page

Name=GoogleURL=google.comDesc=Search English

Model Firefox’

p2’:Page

Name=BaiduURL=baidu.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=BaiduAddr=baidu.comHotkey=Alt+g

i1=i1’i2=i2’

i1=p2i2=p1

:fPpg

Page 45: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Horizontal Delta Interpretation 2

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

45

i1:Item

Name=Google CNAddr=google.comHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1’:Page

Name=BaiduURL=baidu.comDesc=Search English

Model Firefox’

p2’:Page

Name=GoogleURL=google.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=BaiduAddr=baidu.comHotkey=Alt+g

i1=i1’i2=i2’

i1=p1i2=p2

:fPpg

Page 46: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Erroneous vertical composition

A

B’

B

A’

A’’ B’’

r’1

r’2

:bPpg

:fPpg

Page 47: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 48: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Delta-based BX

r

A’

A B

B’

:fPpga

r’

b

r

B’

A B

A’

:bPpg b

r’

a

Forward update propagation

Backward update propagation

R: a set of deltas between two model spaces

Page 49: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Benefits

• Honest math model

• Semantics of DD and DP are separated

• No composition problem

• More flexible

Page 50: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

From delta- to state-based

BA

r

3:fPpg

1:diff

A’

a

B’

b

r'

2:diff

Page 51: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Flexibility of Delta-based BX

BA

r

:fPpg

From stored

delta

A’

a

B’

b

r'

From

Application

Page 52: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Delta-based laws: Consistency

r

A

A

:fPpga

r’ B’

B

b

∈R

∈R

Page 53: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Delta-based laws: Identity

propagation

r

A

A

:fPpgidA

r’ B’

B

idB

Page 54: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 55: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

BX laws are inadequate

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search English

Model IE Model Firefox

55

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p1':Page

Name=GoogleURL=google.comDesc=Search French

Model Firefox’

p2’:Page

Name=Google CNURL=google.comDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=Google CNAddr=google.comHotkey=Alt+g

:fPpg

Page 56: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Extra laws are proposed

• PUTPUT law [Nate et

al. 05]

• Invertibility law

[Diskin08]

• Composability law

[Xiong et al. 07]

A B

A’ B’

1:fPpg

A

2:fPpg

B’’

Undoability law [Stevens’07]B’’ = B

Page 57: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Undoability solves the problem

i2:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

p1:Page

Name=GoogleURL=google.comDesc=Search French

Model IE Model Firefox

57

i1:Item

Name=Google CNAddr=google.comHotkey=Alt+g

p2:Page

Name=Google CNURL=google.comDesc=Search Chinese

p1':Page

Name=GoogleURL=google.comDesc=Search French

Model Firefox’

p2’:Page

Name=Google CNURL=google.cnDesc=Search Chinese

i2’:Item

Name=GoogleAddr=google.comHotkey=Ctrl+g

Model IE’

i1’:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

:fPpg

≠Search English

Page 58: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

But is too strong

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

i1:Item

Name=Google CNAddr=google.cnHotkey=Alt+g

p2:Page

Name=Google CNURL=google.cnDesc=Search Chinese

p2:Page

Name=Google CNURL=google.cnDesc=null

:fPpg

:fPpg

Page 59: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Current Status

• Weak undoability and weak invertibility are

proposed on delta-based BX [Diskin,

Xiong, Czarnecki. MODELS’11]

• Laws are still inadequate

Page 60: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Content

• State-based BXs and related concepts

• Problem of State-based BXs

• Delta-based BXs

• Open Issue: BX laws

• Conclusion

Page 61: From State- to Delta-based Bidirectional Model Transformations · –XML and MOF –Transformation Languages –Bijective Transformations –Bidirectional Transformations • Problem

Conclusion

• BXs are useful in data synchronization

• Deltas are crucial in BXs

• Delta-based BXs

– Honest math model

– Solve the problems in state-based BXs

– More Flexible

• BX laws are still an open problem