June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes - 1 - Transforming models with ATL The A TLAS Transformation Language Frédéric Jouault ATLAS.

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

Copyright Management for the LUISA Semantic Learning Content Management System Roberto García Universitat de Lleida, Spain Tomas Pariente ATOS Origin SAE,
Title © 2006 by INRIA; made available under the EPL v M2M Creation Review Frédéric Jouault Proposed Project Lead.
Title © 2006 by INRIA; made available under the EPL v M2M Creation Review Frédéric Jouault Proposed Project Lead.
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
The role of OCL in the Model Driven Architecture Jos Warmer Klasse Objecten
1 CIS224 Software Projects: Software Engineering and Research Methods Lecture 11 Brief introduction to the UML Specification (Based on UML Superstructure.
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
XML Technology in E-Commerce
ISO DSDL ISO – Document Schema Definition Languages (DSDL) Martin Bryan Convenor, JTC1/SC18 WG1.
OCL2 April A presentation of OCL 2 Object Constraint Language Christian Hein, Fraunhofer FOKUS April 2006.
Page 1 Automatic Evaluation of Modelling Rules and Design Guidelines, July 2006 Automatic Evaluation of Modelling Rules and Design Guidelines Tibor Farkas,
© 2007 ATLAS Nantes 1 Atlas Model Weaver Use Case: Aspect Oriented Modeling Marcos Didonet Del Fabro Atlas Group (INRIA & LINA), Université de Nantes,
Query/Views/Transformations © 2006 ATLAS Nantes Query/Views/Transformations An introduction to the MOF 2.0 QVT standard with focus on the Operational.
Families to Persons © 2007 ATLAS Nantes "Families to Persons" A simple illustration of model-to-model transformation Freddy Allilaire Frédéric Jouault.
Metamodel Global view. Some sources Object Modeling with UML: Advanced Modeling, Karin Palmkvist, Bran Selic, and Jos Warmer, March 2000.
OORPT Object-Oriented Reengineering Patterns and Techniques 13. Model-Driven Development Prof. O. Nierstrasz.
A model-driven course on Petri-Nets, Metamodels and Graph Grammars Pieter Van Gorp Hans Schippers Dirk.
Software Testing and Quality Assurance
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
Object-Oriented Theories for Model Driven Architecture Tony Clark, King’s College, UK. Andy Evans, University of York, UK. Robert France, Colorado University,
Sheet 1© 2005 Lentedagen, 30 March-1 April 2005 IPA Lentedagen on Software Architecture Model Transformations in MDA Ivan Kurtev.
MDE In A Sales Management System: A Case Study © 2008 INRIA, TUD & SAP MDE In A Sales Management System: A Case Study Mathias Fritzsche, Hugo Bruneliere,
MDD Tutorial for managers Eclipse ECESIS Project A presentation of MDD basics Model-driven development (MDD) tutorial for managers EUROPEAN SOFTWARE INSTITUTE,
XML Metadata Interchange (XMI)
Comparing M2T & M2M Complementary Approaches © 2008 INRIA, University of York & SINTEF Comparing M2T & M2M Complementary Approaches Hugo Bruneliere,
Formalizing Material Flow Diagrams How can an MDE approach be used to improve the design process of material handling systems? Robert-Jan Bijl.
1 Ivano Malavolta, University of L’aquila, Computer Science Department Ivano Malavolta DUALLy: an Eclipse platform for architectural languages interoperability.
® Eurostep.ESUKPC v0.1©Copyright Eurostep Limited An Introduction to ISO STEP Part 25 David Price.
Overview of ATL and ETL (Jouault and Kurtev 2006, ‘Transforming Models with ATL’, Proc. MODELS 2005 Workshops, LNCS, vol. 3844, pp Kolovos et.
Advanced Applications Of Model-to-Model Transformation © 2008 INRIA Advanced Applications Of Model-to-Model Transformation Hugo Bruneliere & Frédéric.
Behaviour-Preserving Model Transformation Arend Rensink, University of Twente IPA Spring Days, 18 April 2012.
Composing Models: Principles & Techniques © Copyright TUBS & TUD Composing Models: Principles & Techniques Steven Völkel & Jendrik Johannes.
Understanding Advanced UML Concepts Gerd Wagner
ATL The ATLAS Transformation Language. 2 ATL (ATLAS Transformation Language) ATL transformation pattern ATL metamodel Helpers – Operation helpers – Attribute.
Model transformation with a dedicated imperative language IRISA Rennes (France) - Triskell team Jean-Marc Jézéquel Didier Vojtisek Jean-Philippe Thibault.
Introduction to MDA (Model Driven Architecture) CYT.
1 MDWE'2008, Toulouse, France, September 30, 2008 A Comparative Analysis of Transformation Engines for User Interface Development Juan Manuel González.
Model Handling with EMF Eclipse ECESIS Project Model handling with EMF An introduction to the Eclipse Modeling Framework ATLAS group (INRIA & LINA),
Alignment of ATL and QVT © 2006 ATLAS Nantes Alignment of ATL and QVT Ivan Kurtev ATLAS group, INRIA & University of Nantes, France
Building Tools by Model Transformations in Eclipse Oskars Vilitis, Audris Kalnins, Edgars Celms, Elina Kalnina, Agris Sostaks, Janis Barzdins Institute.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
UML Profiles Eclipse ECESIS Project The UML Profile technology SOFTEAM 144 Ave des Champs Elysées Paris, France
Usage of OCL April Usage of OCL for design guidelines of models Christian Hein, Fraunhofer FOKUS April 2006.
WP 3.3 © Copyright Xactium, TUBS & TUD How to build a set of DSLs: from Theory to Practise Xactium, TUBS, Jendrik Johannes (TUD)
A language to describe software texture in abstract design models and implementation.
Composition of UML Described Refactoring Rules Presented by Chin-Yi Tsai.
Hybrid Transformation Modeling Integrating a Declarative with an Imperative Model Transformation Language Pieter Van Gorp
1 OCL The Role of OCL in UML. 2 רשימת הנושאים  מבוא  מרכיבי השפה  דוגמאות  מקורות.
Introduction to Model-Driven Simulation © 2008 SAP, TU Dresden, XJ Technologies Introduction to Model-Driven Simulation Mathias Fritzsche 1, Jendrik.
An ATL Example © 2005 ATLAS Nantes An ATL Example The BibTeXML to DocBook Transformation ATLAS group (INRIA & LINA), University of Nantes, France.
Verification of behavioural elements of UML models using B Truong, Ninh-Thuan and Souquieres, Jeanine In Proceedings of the 2005 ACM Symposium on.
Template based diagram generation CEA LIST December the 2nd 2010.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
 The need for a formal methodology description  SPEM for describing an agent oriented methodology  PASSI: an example  The needed extension  Discussion.
Sheet 1 DocEng’03, Grenoble, November 2003 Model Driven Architecture based XML Processing Ivan Kurtev, Klaas van den Berg University of Twente, the Netherlands.
DOMAIN MODEL: ADDING ATTRIBUTES Identify attributes in a domain model. Distinguish between correct and incorrect attributes.
Introduction To Model-to-Model Transformation © 2008 INRIA Introduction To Model-to-Model Transformation Hugo Bruneliere & Frédéric Jouault INRIA.
Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 6-1b. Atlas Transformation Language (ATL) with RSM.
An Introduction to Metamodelling Eclipse ECESIS Project An Introduction to Metamodelling Principles & Fundamentals Department of Computer Science,
Business Informatics Group Institute of Software Technology and Interactive Systems Vienna University of Technology Favoritenstraße 9-11/188-3, 1040 Vienna,
Sheet 1MDAFA2004 Linköping, June 2004 A Language for Model Transformations in the MOF Architecture Ivan Kurtev, Klaas van den Berg University of Twente,
Semantic metadata in the Catalogue Frédéric Houbie.
UNIT-IV Designing Classes – Access Layer ‐ Object Storage ‐ Object Interoperability.
Business Process Measures
Rational Worldwide Software Symposium
Towards Automatic Model Synchronization from Model Transformation
Design of Transmission Pipeline Modelling Language
Rational Worldwide Software Symposium
Software Architecture & Design
Presentation transcript:

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Transforming models with ATL The A TLAS Transformation Language Frédéric Jouault ATLAS group (INRIA & LINA), University of Nantes, France

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Context of this work The present courseware has been elaborated in the context of the MODELWARE European IST FP6 project ( Co-funded by the European Commission, the MODELWARE project involves 19 partners from 8 European countries. MODELWARE aims to improve software productivity by capitalizing on techniques known as Model-Driven Development (MDD). To achieve the goal of large-scale adoption of these MDD techniques, MODELWARE promotes the idea of a collaborative development of courseware dedicated to this domain. The MDD courseware provided here with the status of open source software is produced under the EPL 1.0 license.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Prerequisites To be able to understand this lecture, a reader should be familiar with the following concepts, languages, and standards: Model Driven Engineering (MDE) The role of model transformations in MDE UML OCL MOF Basic programming concepts

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Contents Introduction Description of ATL Example: Class to Relational Additional considerations Conclusion

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Contents Introduction Definitions Operational context Description of ATL Example: Class to Relational Additional considerations Conclusion

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Definitions A model transformation is the automatic creation of target models from source models. Model transformation is not only about M1 to M1 transformations: M1 to M2: promotion, M2 to M1: demotion, M3 to M1, M3 to M2, etc. Metametamodel Metamodel Terminal Model M3 M2 M1

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes G 2 P Rule R 2 B Rule Operational context: small theory MaMb MMa Green Class Red Class MMb Blue Class Pink Class Metametamodel Class ATL Rule Class MMa2MMb.atl conformsTo

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Operational context of ATL MOF MMa MMb Ma Mb MMa2MMb.atl ATL MMa is the source metamodel Ma is the source model Mb is the target model MMB is the target metamodel

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Contents Introduction Description of ATL Overview Source pattern Target pattern Execution order Example: Class to Relational Additional considerations Conclusion

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL overview Source models and target models are distinct: Source models are read-only (they can only be navigated, not modified), Target models are write-only (they cannot be navigated). The language is a declarative-imperative hybrid: Declarative part: Matched rules with automatic traceability support, Side-effect free navigation (and query) language: OCL 2.0 Imperative part: Called rules, Action blocks. Recommended programming style: declarative

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL overview (continued) A declarative rule specifies: a source pattern to be matched in the source models, a target pattern to be created in the target models for each match during rule application. An imperative rule is basically a procedure: It is called by its name, It may take arguments, It can contain: A declarative target pattern, An action block (i.e. a sequence of statements), Both.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL overview (continued) Applying a declarative rule means: Creating the specified target elements, Initializing the properties of the newly created elements. There are three types of declarative rules: Standard rules that are applied once for each match, A given set of elements may only be matched by one standard rule, Lazy rules that are applied as many times for each match as it is referred to from other rules (possibly never for some matches), Unique lazy rules that are applied at most once for each match and only if it is referred to from other rules.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Declarative rules: source pattern The source pattern is composed of: A labeled set of types coming from the source metamodels, A guard (Boolean expression) used to filter matches. A match corresponds to a set of elements coming from the source models that: Are of the types specified in the source pattern (one element for each type), Satisfy the guard.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Declarative rules: target pattern The target pattern is composed of: A labeled set of types coming from the target metamodels, For each element of this set, a set of bindings. A binding specifies the initialization of a property of a target element using an expression. For each match, the target pattern is applied: Elements are created in the target models (one for each type of the target pattern), Target elements are initialized by executing the bindings: First evaluating their value, Then assigning this value to the corresponding property.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Execution order of declarative rules Declarative ATL frees the developer from specifying execution order: The order in which rules are matched and applied is not specified. Remark: the match of a lazy or unique lazy rules must be referred to before the rule is applied. The order in which bindings are applied is not specified. The execution of declarative rules can however be kept deterministic: The execution of a rule cannot change source models  It cannot change a match, Target elements are not navigable  The execution of a binding cannot change the value of another.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Contents Introduction Description of ATL Example: Class to Relational Overview Source metamodel Target metamodel Rule Class2Table Rule SingleValuedAttribute2Column Rule MultiValuedAttribute2Column Additional considerations Conclusion

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, overview The source metamodel Class is a simplification of class diagrams. The target metamodel Relational is a simplification of the relational model.  ATL declaration of the transformation: module Class2Relational; create Mout : Relational from Min : Class; The transformation excerpts used in this presentation come from:

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Source: the Class metamodel NamedElt + name : String Classifier Attribute + multivalued : Boolean type + DataType Class attr + * { ordered } owner

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes package Class { abstract class NamedElt { attribute name : String; } abstract class Classifier extends NamedElt {} class DataType extends Classifier {} class Class extends Classifier { reference attr[*] ordered container : Attribute oppositeOf owner; } class Attribute extends NamedElt { attribute multiValued : Boolean; reference type : Classifier; reference owner : Class oppositeOf attr; } *For more information on KM3 see The Class Metamodel in KM3* NamedElt + name : String Classifier Attribute + multivalued : Boolean type + DataType Class attr + * { ordered } owner

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes The Relational Metamodel Named + name : String Table Column owner + col + * { ordered } keyOf key + * Type * type +

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes package Relational { abstract class Named { attribute name : String; } class Table extends Named { reference col[*] ordered container : Column oppositeOf owner; reference key[*] : Column oppositeOf keyOf; } class Column extends Named { reference owner : Table oppositeOf col; reference keyOf[0-1] : Table oppositeOf key; reference type : Type; } class Type extends Named {} } The Relational Metamodel in KM3 Named + name : String Table Column owner + col + * { ordered } keyOf key + * Type * type +

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, overview Informal description of rules Class2Table: A table is created from each class, The columns of the table correspond to the single-valued attributes of the class, A column corresponding to the key of the table is created. SingleValuedAttribute2Column: A column is created from each single-valued attribute. MultiValuedAttribute2Column: A table with two columns is created from each multi-valued attribute, One column refers to the key of the table created from the owner class of the attribute, The second column contains the value of the attribute.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, rule Class2Table A Table is created for each Class: rule Class2Table { from-- source pattern c : Class!Class to-- target pattern t : Relational!Table }

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, rule Class2Table The name of the Table is the name of the Class: rule Class2Table { from c : Class!Class to t : Relational!Table ( name <- c.name-- a simple binding ) }

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, rule Class2Table The columns of the table correspond to the single-valued attributes of the class: rule Class2Table { from c : Class!Class to t : Relational!Table ( name <- c.name, col select(e |-- a binding not e.multiValued-- using )-- complex navigation ) } Remark: attributes are automatically resolved into columns by automatic traceability support.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, rule Class2Table Each Table owns a key containing a unique identifier: rule Class2Table { from c : Class!Class to t : Relational!Table ( name <- c.name, col select(e | not e.multiValued )->union(Sequence {key}), key <- Set {key} ), key : Relational!Column (-- another target name <- ‘Id’-- pattern element )-- for the key }

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, rule SingleValuedAttribute2Column A Column is created for each single-valued Attribute: rule SingleValuedAttribute2Column { from-- the guard is used for selection a : Class!Attribute (not a.multiValued) to c : Relational!Column ( name <- a.name ) }

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Example: Class to Relational, rule MultiValuedAttribute2Column A Table is created for each multi-valued Attribute, which contains two columns: The identifier of the table created from the class owner of the Attribute The value. rule MultiValuedAttribute2Column { from a : Class!Attribute (a.multiValued) to t : Relational!Table ( name <- a.owner.name + ‘_’ + a.name, col <- Sequence {id, value} ), id : Relational!Column ( name <- ‘Id’ ), value : Relational!Column ( name <- a.name ) }

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Contents Introduction Description of ATL Example: Class to Relational Additional considerations Other ATL features ATL in use Conclusion

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Other ATL features: rule inheritance Rule inheritance, to help structure transformations and reuse rules and patterns: A child rule matches a subset of what its parent rule matches,  All the bindings of the parent still make sense for the child, A child rule specializes target elements of its parent rule: Initialization of existing elements may be improved or changed, New elements may be created, Syntax: abstract rule R1 { } rule R2 extends R1 { }

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Other ATL features: refining mode Refining mode for transformations that need to modify only a small part of a model: Since source models are read-only target models must be created from scratch, This can be done by writing copy rules for each elements that are not transformed,  This is not very elegant, In refining mode, the ATL engine automatically copies unmatched elements. The developer only specifies what changes. ATL semantics is respected: source models are still read-only.  An (optimized) engine may modify source models in-place but only commit the changes in the end. Syntax: replace from by refining module A2A; create OUT : MMA refining IN : MMA;

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL in use ATL has been used in a large number of application domains. A library of transformations is available at More than 40 scenarios, More than 100 single transformations. About 100 sites use ATL for various purpose: Teaching, Research, Industrial development, Etc.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL in use ATL tools and documentation are available at Execution engine: Virtual machine, ATL to bytecode compiler, Integrated Development Environment (IDE) for: Editor with syntax highlighting and outline, Execution support with launch configurations, Source-level debugger. Documentation: Starter’s guide, User manual, Installation guide, Etc.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL Development Tools: perspective, editor and outline

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL Development Tools: launch configuration

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes ATL Development Tools: source-level debugger

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Contents Introduction Description of ATL Example: Class to Relational Additional considerations Conclusion

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Conclusion ATL has a simple declarative syntax:  Simple problems are generally solved simply. ATL supports advanced features: Complex OCL navigation, lazy rules, refining mode, rule inheritance, etc.  Many complex problems can be handled declaratively. ATL has an imperative part:  Any problem can be handled.

June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes End of the presentation  Thanks  Questions?  Comments? ATLAS group, INRIA & LINA, Nantes