A Linguistic Approach to Model Synchronization Yingfei Xiong Ph.D., University of Tokyo Advisors: Zhenjiang Hu and Masato Takeichi 1.

Slides:



Advertisements
Similar presentations
A Method for Validating Software Security Constraints Filaret Ilas Matt Henry CS 527 Dr. O.J. Pilskalns.
Advertisements

An Object/Relational Mapping tool Free and open source Simplifies storage of object data in a relational database Removes the need to write and maintain.
Programming Paradigms and languages
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 8 Slide 1 System modeling 2.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Software Testing and Quality Assurance
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
Software Evolution Managing the processes of software system change
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Understanding Metamodels. Outline Understanding metamodels Applying reference models Fundamental metamodel for describing software components Content.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
Creating Architectural Descriptions. Outline Standardizing architectural descriptions: The IEEE has published, “Recommended Practice for Architectural.
ASP.NET Programming with C# and SQL Server First Edition
BUSINESS DRIVEN TECHNOLOGY
1 Chapter 2 Reviewing Tables and Queries. 2 Chapter Objectives Identify the steps required to develop an Access application Specify the characteristics.
Course Instructor: Aisha Azeem
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
Enterprise Object Framework. What is EOF? Enterprise Objects Framework is a set of tools and resources that help you create applications that work with.
Impact Analysis of Database Schema Changes Andy Maule, Wolfgang Emmerich and David S. Rosenblum London Software Systems Dept. of Computer Science, University.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
February Semantion Privately owned, founded in 2000 First commercial implementation of OASIS ebXML Registry and Repository.
Introduction To System Analysis and design
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Chapter 10 Architectural Design
A Survey of Software Refactoring Tom Mens, Tom Tourwé
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
Supporting Automatic Model Inconsistency Fixing Yingfei Xiong University of Tokyo, Japan Zhenjiang HuNational Institute of Informatics, Japan Haiyan ZhaoPeking.
© 2010 HCMUNS. NII-Internship program proposal: Evolution of modeling languages and models Submitted by: BUI TAN LOC NII Supervisor: Professor ZHENJIANG.
Introduction to MDA (Model Driven Architecture) CYT.
CoFM: An Environment for Collaborative Feature Modeling Li Yi Institute of Software, School of EECS, Peking University Key Laboratory of High Confidence.
CSE 219 Computer Science III Program Design Principles.
Storing Organizational Information - Databases
Frontiers in Massive Data Analysis Chapter 3.  Difficult to include data from multiple sources  Each organization develops a unique way of representing.
Beanbag: A Framework for On- Site Synchronization Yingfei Xiong (speaker), University of Tokyo Zhenjiang Hu, National Institute of Informatics / University.
1 OCL Tools Supervised by Prof. Daniel Amyot May Khalil Nadia Spido Submitted to Professor Daniel Amyot in partial fulfillment of the requirements for.
© 2005 Prentice Hall10-1 Stumpf and Teague Object-Oriented Systems Analysis and Design with UML.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
McGraw-Hill/Irwin © 2008 The McGraw-Hill Companies, All Rights Reserved Chapter 7 Storing Organizational Information - Databases.
Controlling Execution Programming Right from the Start with Visual Basic.NET 1/e 8.
Supporting Parallel Updates with Bidirectional Model Transformations Yingfei Xiong and Masato Takeichi University of Tokyo, Japan Song Hui Peking University,
9-1 © Prentice Hall, 2007 Chapter 9: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
Beanbag: Facilitating Model Inconsistency Fixing Yingfei Xiong Ph.D. Student Advisor: Zhenjiang Hu and Masato Takeichi University of Tokyo 1.
The Volcano Optimizer Generator Extensibility and Efficient Search.
Beanbag: Operation-based Synchronization with Intra-Relation Support Yingfei Xiong Ph.D. Student University of Tokyo.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
GSD Lab, University of Waterloo Yingfei Xiong, 2011.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
THE SEMANTIC WEB By Conrad Williams. Contents  What is the Semantic Web?  Technologies  XML  RDF  OWL  Implementations  Social Networking  Scholarly.
7-1 © Prentice Hall, 2007 Topic 7: Analysis Classes Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey.
(1) ICS 313: Programming Language Theory Chapter 11: Abstract Data Types (Data Abstraction)
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Yu, et al.’s “A Model-Driven Development Framework for Enterprise Web Services” In proceedings of the 10 th IEEE Intl Enterprise Distributed Object Computing.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Data Modeling Using the Entity- Relationship (ER) Model
Building Enterprise Applications Using Visual Studio®
Elaboration popo.
Chapter (12) – Old Version
Analysis Classes Unit 5.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Ontology Evolution: A Methodological Overview
Beanbag : Support Synchronization in Software Engineering Applications
Towards Automatic Model Synchronization from Model Transformation
Synchronizing Software Engineering Artifacts
Design Model Like a Pyramid Component Level Design i n t e r f a c d s
Automated Analysis and Code Generation for Domain-Specific Models
Practical Database Design and Tuning Objectives
Software Architecture & Design
Presentation transcript:

A Linguistic Approach to Model Synchronization Yingfei Xiong Ph.D., University of Tokyo Advisors: Zhenjiang Hu and Masato Takeichi 1

Bio 2000~2004, UESTC, B.Eng 2004~2006, Peking University 2006~2009, University of Tokyo, Ph.D. 2009~2011?, University of Waterloo, Postdoc

Model Driven Engineering An emerging paradigm for software development Capturing software artifacts as models Developing software by transforming and refining models 3 Feature model UML model Database model Deployment model

Model Synchronization Consistency need to be established over all models When one model is updated, the update need to be propagated across all models 4 Feature model UML model Database model Deployment model Consistent update

Running Example 5 Database Design Tool Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Table name = Book owner= admin Column name = price_value type = Float UML Modeling Tool 5 Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Column name = price_currency type = String Column name = title type = String Equal

Running Example 6 Database Design Tool Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Table name = Book owner= admin Column name = price_value type = Float UML Modeling Tool 6 Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Column name = price_currency type = String Column name = title type = String Publication

Synchronizer Synchronizing models is not easy – Identify affected locations – Propagate updates to these locations – Trade off between different propagation strategies Synchronizers are needed – A synchronizer propagates updates automatically to make all models consistent when user modify models 7

Existing Approaches AdHoc Synchronizers [FGH+94, GHM98] Bidirectional Transformations [Ste07, SK08b] 8

Adhoc synchronizers [FGH+94, GHM98] For adhoc cases Implemented in languages like Java or C++ Example: If (t is a table&& t.name changes to x) { find the corresponding class c; c.name = x; } Problems: – Difficult to develop – Difficult to maintain 9

Bidirectional Transformation [Ste07, SK08b] 10 Updated UML model Database model Updated database model Forward Transformation UML model Updated database model Updated UML model Backward Transformation Consistency Relation in Bidirectional Languages generate

Problems of Bidirectional Transformation Problem 1: Developers have to learn a new language Problem 2: Not allow parallel updates on the two models Problem 3: Support limited types of consistency relation – Not support on-site synchronization 11

Off-Site Synchronization Synchronize between two applications Application A Synchronizer Application B Models of Application A Models of Application B 12

On-Site Synchronization Synchronization within One Application Application Synchronizer UML Modeling Tool 13 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Equal

On-Site Synchronization Synchronization within One Application Application Synchronizer UML Modeling Tool 14 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String BookPrice

Our Approach AdHoc Synchronizers [FGH+94, GHM98] Bidirectional Transformations [Ste07, SK08b] Our Approach 15

Our Approach Bidirectional Transformation More friendly language More types of consistency relations More types of updates 16

Our Approach Synchronizer Consistency Relation in Existing Languages generate 17

Our Approach Synchronizer Consistency Relation in Existing Languages generate Consistency Relation is specified in existing relation-specifying languages Benefit Reusing existing programs Reusing developer knowledge Different languages for different situations Consistency Relation is specified in existing relation-specifying languages Benefit Reusing existing programs Reusing developer knowledge Different languages for different situations 18

Our Approach Synchronizer Consistency Relation in Existing Languages generate Allowing parallel updates over different models 19

Our Approach Synchronizer Consistency Relation in Existing Languages generate Supporting more consistency relation description, particularly, on-site synchronization 20

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 21 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 22 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Requirement of Model Synchronization Three properties – Consistency – Preservation – Stability A synchronizer is correct only if it satisfies the three properties 23

Consistency After synchronization, the data should be consistent 24 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Table name = Book owner= admin Column name = price_value type = Float 24 Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Column name = price_currency type = String Column name = title type = String Equal Publication

Consistency After synchronization, the data should be consistent 25 Class name = Publication persistent= true Attribute name = price type=Price Attribute name = title type=String Table name = Publication owner= admin Column name = price_value type = Float 25 Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Column name = price_currency type = String Column name = title type = String Equal

Preservation Synchronizer cannot overwrite user updates 26 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Table name = Book owner= admin Column name = price_value type = Float 26 Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Column name = price_currency type = String Column name = title type = String Publication Book

Stability If users change nothing, the synchronizer changes nothing 27 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String Table name = Book owner= admin Column name = price_value type = Float 27 Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Column name = price_currency type = String Column name = title type = String

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 28 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Why Dictionaries? Models are defined by MOF Standard – contains a lot of concepts – easy for end users – difficult for researchers Our contribution – Defining a small dictionary structure – Defining updates on dictionaries – Representing most frequently used concepts in models 29

Dictionaries A dictionary maps keys to values – {“name”->”Book”, “persistent”->true} – {1->{5->”a”, 4->”b”}, 2->{3->”x”, 4->”y”}} An update on dictionary is also a dictionary mapping from keys to updates {1->”a”, 2->”b”, 3->”c”},4->”y” “x” {1->!”x”, 2->!null, 4->!”y”} 30

Representing Models {1->{name->Price, persistent->false, __type->Class}, 2->{name->currency, type->String, parent->1, __type->Attribute}, } 31 Class name = Price persistent= false Attribute name = currency type = String 1 2 A model maps id to objects Assign an ID to each object An object maps attribute names to attribute values Reference values are IDs of the referred object type information is stored in “__type”

Representing Models {1->{name->Price, persistent->false, __type->Class}, 2->{name->currency, type->String, parent->1, __type->Attribute}, } 32 Class name = Price persistent= false Attribute name = currency type = String 1 2

Representing Models {1->{name->Price, persistent->false, __type->Class}, 2->{name->currency, type->String, parent->1, __type->Attribute}, } 33 Class name = Price persistent= false Attribute name = currency type = String 1 2

Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Representing Updates Updates on models are converted to updates on dictionaries BookPrice {1->{Name->!BookPrice}} 34

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 35 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Off-Site Synchronization In practice, what we have is UML model Database model Unidirectional Transformation 36

Off-Site Synchronization What we need is UML model Database model Off-Site Synchronizer Updated UML model Updated database model Synchronized UML model Synchronized database model 37

Unidirectional Transformation Program ATL Transformation Program Our Approach UML model Database model Off-Site Synchronizer Updated UML model Updated database model Synchronized UML model Synchronized database model 38

Evaluation Applied to five real world ATL transformations – UML to Database – UML to Java – BibTex to DocBook – Make to Ant – Book to Publication Working well in all programs 39 A page on ATL web site listing real world ATL programs

Implementation and Impact Our approach has been implemented and has been used by other researchers [YKW+08] In addition, our ASE paper has been cited 40 times ( , Google Scholar), and is one of the most cited paper in ASE SyncATL Website

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 41 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Motivation In some cases, we already have a a bidirectional transformation but the two models may be updated at the same time Updated UML model Database model Updated database model Forward Transformation UML model Updated database model Updated UML model Backward Transformation 42

Our Approach Derive a synchronizer from a pair of change- propagating transformations Forward Transformation Backward Transformation Off-Site Synchronizer 43

Properties of Bidirectional Transformation [Ste07] Do the two transformations fit together? – Correctness – Hippocraticness 44

Relation between Properties Bidirectional transformation properties lead to synchronization properties Forward Transformation Backward Transformation Forward Transformation Backward Transformation Synchronizer Correctness Hippocraticness Consistency Stability Preservation 45

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 46 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Object Constraint Language (OCL) OCL is a first-order logic language used to define and check relations over models attribute.type=“String” or attribute.type=“Float” or allClasses->exists(class | class.name = attribute.type) OCL is also used by adhoc synchronizer developers for dynamically assert the correctness of synchronizers 47 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String UML Modeling Tool Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Equal

Idea: Derive a Synchronizer from an OCL Expression Synchronizer OCL Expression 48

Problem: Synchronization Behavior Ambiguity 49 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String UML Modeling Tool Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String UML Modeling Tool Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String BookPrice Class name = BookPrice persistent= false

Our Approach Beanbag – similar to OCL syntactically – has enriched constructs for confining synchronization behavior Every Beanbag Program has two types of semantics – Checking semantics for checking whether the relation is satisfied – Synchronization semantics for synchronize updates 50

Beanbag Overview On-Site Synchronizer Beanbag Program Updates 51

DEMO 52

Overview: Constructs in Beanbag expr ::= variable | constant | expr.expr | not expr | expr=expr | expr and expr | expr or expr | expr->forall(v|expr) | expr->exists(v|expr) | expr->exists!(v|expr) 53

Overview: Enriched Constructs for Specifying Synchronization Behavior OCL ConstructsEnriched Constructs expr1=expr2 expr2=expr1 expr1 and expr2 expr2 and expr1 expr1 or expr2 expr2 or expr1 expr->exists(v | expr)expr->exists(v | expr) expr->exists!(v | expr) 54

Specifying Synchronization Behavior def rel(attribute, allClasses) = attribute.type=“String” or attribute.type=“Float” or allClasses->exists(class | class.name = attribute.type) 55 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String UML Modeling Tool Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String BookPrice Class name = BookPrice persistent= false

Specifying Synchronization Behavior def rel(attribute, allClasses) = attribute.type=“String” or attribute. type=“Float” or allClasses->exists!(class | class.name = attribute. type) 56 Class name = Book persistent= true Attribute name = price type=Price Attribute name = title type=String UML Modeling Tool Class name = Price persistent= false Attribute name = value type = Float Attribute name = currency type = String BookPrice

How we compile a Beanbag program Consider an example: – Relation: a=b and b=c Basic relations (like a=b) Primitive synchronizers Connectives (like and, or, forall) gluing their inner synchronizers into a bigger synchronizer 57 a=b b=c and

Primitive Synchronizer: a=b 58 a=2 b=2 3 3 a=2 b=2 3 3 a=2 b=2 3 3 a=2 b=2 3 4 report conflict a=b

Combinator a=b b=c and a=3 b=3 c=

Evaluation Steps – collected 84 consistency relations from MOF standard, UML standard, and industry [Egyed07] – identified requirements for 24 synchronizer – implementing these programs in Beanbag Result – implemented 17 programs, 71% of all programs – The rest 7 programs can be implemented with minor extensions to Beanbag 60

Implementation Beanbag has been implemented and published on the web An old version has been used by several researchers [RKK+09] 61 A graphic UML synchronization tool that is developed by University of Malaga using Beanbag

Contributions Requirement of Model Synchronization (Chapter 2) Dictionary-based Representation of Models and Updates (Chapter 3) Unidirectional Transformation Off-Site Synchronizer Bidirectional Transformation Off-Site Synchronizer Logic Expression On-Site Synchronizer 62 Application: Runtime Management Framework (Section 5.5) 09) Application: Runtime Management Framework (Section 5.5) 09) Chapter 4 ASE07 Chapter 5 ICMT09 Chapter 6,7 FSE09

Application: Runtime Management Framework Server 10 Client calcu 1 Client phone1 2 Client tablet 5 synchronize read write Bluetooth Wi-Fi Ethernet a running system A management interface

Architecture of the Runtime Management Framework 64 Runtime Management UI Running System Synchronizer QVT program generate

Summary Formalization of model synchronization – Requirement of model synchronization – Dictionary-based representation of models and updates Support for off-site synchronization – from unidirectional transformation (ASE07) – from bidirectional transformation (ICMT09) Support for on-site synchronization – A first-order logic language (FSE09a, submitted) Application (FSE09b, submitted) 65

Future Work - Horizontal Current Approach More Data Types (Ordered Data) More Consistent Relations 66

Future Work - Vertical Testing and debugging Conflict management High-level language for synchronization Our approach 67

68

Reference [ELF08] Alexander Egyed, Emmanuel Letier, and Anthony Finkelstein. Generating and evaluating choices for fixing inconsistencies in UML design models. ASE08. [NEF03] Christian Nentwich, Wolfgang Emmerich, and Anthony Finkelstein. Consistency management with repair actions. ICSE03. [FGH+94] A. C. W. Finkelstein, D. Gabbay, A. Hunter, J. Kramer, and B. Nuseibeh. Inconsistency handling in multiperspective specifications. TSE94. [GHM98] John Grundy, John Hosking, and Warwick B. Mugridge. Inconsistency management for multiple- view software development environments. TSE98. 69

Reference [Ste07] Perdita Stevens. Bidirectional model transformations in QVT: Semantic issues and open questions. MoDELS07. [SK08b] Andy Schurr and Felix Klar. 15 years of triple graph grammars. ICGT08. [RKK+09] Daniel Ruiz-Gonzalez, Nora Koch, Christian Kroiss, Jose-Raul Romero, Antonio Vallecillo. Viewpoint Synchronization of UWE Models. (submitted for publication). [YKW+08] Yijun Yu, Haruhiko Kaiya, Hironori Washizaki, Yingfei Xiong, Zhenjiang Hu and Nobukazu Yoshioka. Enforcing a security pattern in stakeholder goal models. QoP08. 70