Beanbag : Support Synchronization in Software Engineering Applications

38
Beanbag : Support Synchronization in Software Engineering Applications Yingfei Xiong 3 rd Year Ph.D. Student University of Tokyo 1

description

Beanbag : Support Synchronization in Software Engineering Applications. Yingfei Xiong 3 rd Year Ph.D. Student University of Tokyo. Beanbag : Transformation between Views in Each Phase of ABC. Yingfei Xiong 3 rd Year Ph.D. Student University of Tokyo. - PowerPoint PPT Presentation

Transcript of Beanbag : Support Synchronization in Software Engineering Applications

Page 1: Beanbag : Support Synchronization in Software Engineering Applications

Beanbag : Support Synchronization in Software Engineering Applications

Yingfei Xiong3rd Year Ph.D. Student

University of Tokyo

1

Page 2: Beanbag : Support Synchronization in Software Engineering Applications

Beanbag : Transformation between Views in Each Phase of ABC

Yingfei Xiong3rd Year Ph.D. Student

University of Tokyo

2

Page 3: Beanbag : Support Synchronization in Software Engineering Applications

Example: An EJB Modeling Tool(Enterprise JavaBeans)

PersonEJB

PersonEJB

SignModule

SignModule

SignModule

3

Page 4: Beanbag : Support Synchronization in Software Engineering Applications

Requirements

• Some consistency relation exists over data

Equal

Equal

4

Page 5: Beanbag : Support Synchronization in Software Engineering Applications

Requirements

• When users update some parts, we need to update some other parts

PersonEJB

PersonEJB

5

Page 6: Beanbag : Support Synchronization in Software Engineering Applications

Requirements(Preservation)

• We cannot overwrite user updates

PersonEJBUserEJB

6

Page 7: Beanbag : Support Synchronization in Software Engineering Applications

Requirements (Consistency)

• After updating, the data should satisfy the consistency relation

PersonEJB

PersonEJB

PersonEJB

PersonEJB

Equal

7

Page 8: Beanbag : Support Synchronization in Software Engineering Applications

Existing Bi-Tran Approaches

• Synchronizing between off-the-shelf applications

• Independent of applications• Working on external copies of data

Application A

------------------------------------------------

Bi-Trans

------------------------------------------------

Application B

Data of Application A

Data of Application B

XMLXML

8

Page 9: Beanbag : Support Synchronization in Software Engineering Applications

Synchronization in Software Engineering Applications

• Synchronization is part of the application, and is considered from requirements.

• Synchronizer is tightly integrated into the application

ApplicationSynchronizer

Application Data9

Page 10: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

Equal

Equal

10

Needs to deal with inter-relations as well as intra-relations

Page 11: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

User

User

11

Needs to deal with inter-relations as well as intra-relations

Page 12: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

Dependent Equal

12

Needs to deal with inter-relations as well as intra-relations

Page 13: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

SignModule

SignModule

13

Needs to deal with inter-relations as well as intra-relations

Page 14: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

SignOn

SignModule?14

Calls for operation-based synchronization

Page 15: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

SignModule

15

Calls for operation-based synchronization

Page 16: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

16

Often has multiple choices in synchronization

Page 17: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

17

Often has multiple choices in synchronization

Page 18: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

18

Often has multiple choices in synchronization

Page 19: Beanbag : Support Synchronization in Software Engineering Applications

Characteristics

false

19

Often has multiple choices in synchronization

Page 20: Beanbag : Support Synchronization in Software Engineering Applications

Our Contribution: Beanbag

• Beanbag(お手玉,沙包 ) is also a traditional Asian game for keeping several beanbags consistent

The picture is obtained from www.city.kodaira.tokyo.jp

• A framework supporting synchronization in software engineering applications

20

Page 21: Beanbag : Support Synchronization in Software Engineering Applications

An Overview of Beanbag

Application Data

Synchronizer

Updates

Updates

Users

------------------------------------------------

Beanbag Program

Compile

21

Page 22: Beanbag : Support Synchronization in Software Engineering Applications

Features of Beanbag

Application Data

Synchronizer

Updates

Updates

Users

------------------------------------------------

Beanbag Program

Compile

Intra-relations and inter-relations are captured in a

unified way

Allow fine control over synchronization behavior

Operation-based Synchronization with no propagation direction

imposed

22

Page 23: Beanbag : Support Synchronization in Software Engineering Applications

Beanbag Program for the EJBmain(ejbs, modules, entitybeans) { containmentRefs<attr="Module">(ejbs, modules); for [ejb, entitybean] in [ejbs, entitybeans] { persistent(ejb, entitybean, modules) | nonPersistent(ejb, entitybean) | {ejb = null; entitybean = null} }}

23

Page 24: Beanbag : Support Synchronization in Software Engineering Applications

Beanbag Program for the EJB persistent(ejb, entitybean, modules) { var moduleRef, moduleName, module; ejb."Persistent" = true; entitybean."EJBName" = ejb."Name"; moduleRef = ejb."Module"; !modules.moduleRef = module; entitybean."ModuleName" = module.”Name”;}nonPersistent(ejb, entitybean){ ejb."Persistent" = false; entitybean = null;}

24

Page 25: Beanbag : Support Synchronization in Software Engineering Applications

Describing Updates

1

2

3

4 5

6

Assign a unique id for each object

25

Page 26: Beanbag : Support Synchronization in Software Engineering Applications

Describing Updates

1

3

4 5

6

Describing attribute modification

User

2

ejbs: {2->{“Name”->!”User”}}modules: voidentityBeans: void 26

Page 27: Beanbag : Support Synchronization in Software Engineering Applications

Describing Updates

1

3

4 5

6

Describing deletion

2

ejbs: voidmodules: {4->!null}entityBeans: void 27

Page 28: Beanbag : Support Synchronization in Software Engineering Applications

Describing Updates

1

3

4 5

6

Describing Insertion

2

AccessRight : EJBPersistent = true

7

ejbs: {7->{“Name”->!”AccessRight”,“Persistent”->!true}}modules: voidentityBeans: void 28

Page 29: Beanbag : Support Synchronization in Software Engineering Applications

An Update Propagation of EJB Tool

User Synchronizer

ejbs: {2->{“Name”->!”User”}}modules: voidentityBeans: void

ejbs: {2->{“Name”->!”User”}}modules: voidentityBeans: {5->{“Name”->!”User”}}

------------------------------------------------

EJB Program

CompileUser

1

3

4

2

5

6

29

Page 30: Beanbag : Support Synchronization in Software Engineering Applications

Review: Multiple Choices

30

Page 31: Beanbag : Support Synchronization in Software Engineering Applications

Review: Multiple Choices

false

31

Page 32: Beanbag : Support Synchronization in Software Engineering Applications

Beanbag Program for the EJBmain(ejbs, modules, entitybeans) { containmentRefs<attr="Module">(ejbs, modules); for [ejb, entitybean] in [ejbs, entitybeans] { persistent(ejb, entitybean, modules) | nonPersistent(ejb, entitybean) | {ejb = null; entitybean = null} }}

main(ejbs, modules, entitybeans) { containmentRefs<attr="Module">(ejbs, modules); for [ejb, entitybean] in [ejbs, entitybeans] { persistent(ejb, entitybean, modules) | {ejb = null; entitybean = null} | nonPersistent(ejb, entitybean) }}

32

Page 33: Beanbag : Support Synchronization in Software Engineering Applications

How we compile a Beanbag program

Consider an example:{ var c; c=a.”Name”; c=b.”Name”;}

Basic relations (like a=b, a.”name”=b) Primitive synchronizers

Gluing constructs (like conjunction “;”)

gluing their inner synchronizers into a bigger synchronizer

33

Page 34: Beanbag : Support Synchronization in Software Engineering Applications

c=a.“Name”

c=a.“Name”

a: {“Persistent”->!true}c: !”X”

a: {“Persistent”->!true, “Name”->!”X”}c: !”X”

34

Page 35: Beanbag : Support Synchronization in Software Engineering Applications

c=a.“Name”

c=a.“Name”

a: {“Name”->!”Y”}c: !”X”

Failure!

35

Page 36: Beanbag : Support Synchronization in Software Engineering Applications

Conjunction

{var c; c=a.”name”; c=b.”name”}

a: voidb: {“name”->!”x”}

a: {“name”->!”x”}b: {“name”->!”x”}

c=b.”name”

b: {“name”->!”x”}c: void

b: {“name”->!”x”}c: !”x”

c=a.”name”

a: voidc: !x

a: {“name”->!”x”}c: !”x”

36

Page 37: Beanbag : Support Synchronization in Software Engineering Applications

Find out more

• We have implemented Beanbag in Java and published under MIT license– http

://www.ipl.t.u-tokyo.ac.jp/~xiong/beanbag.html

• Copies of technique reports are available in the front desk

37

Page 38: Beanbag : Support Synchronization in Software Engineering Applications

Conclusion

• We propose a new language, Beanbag, to support synchronization in software engineering applications

• Beanbag captures inter-relations and intra-relations in a unified way

• Beanbag supports operation-based synchronization with no propagation direction imposed

• Beanbag allows fine control over synchronization behavior

38