ATL: ATLAS Transformation Language. MISO - Uniandes

Similar documents
ATL: ATLAS Transformation Language

ETL: Epsilon Transformation Language. MISO - Uniandes

Model transformations. Overview of DSLE. Model transformations. Model transformations. The 4-layer architecture

ATL: Atlas Transformation Language. ATL User Manual

Model Transformation Exercices Date 19/10/2018. Context of this work

ATL Transformation. Catalogue of Model Transformations

ADT: Eclipse development tools for ATL

TOWARDS MODEL TRANSFORMATION DESIGN PATTERNS

Model transformations. Model transformations. Model transformations. Model transformations

QVT: Query, Views, Transformations

Copying Subgraphs within Model Repositories

The Meta-Object Facility (MOF)

ATL Transformation Examples. The KM3 to Metric ATL transformation

The Eclipse Modeling Framework and MDA Status and Opportunities

ATL Transformation. Catalogue of Model Transformations

Acceleo Galileo Simultaneous Release

ATL TRANSFORMATION EXAMPLE

Kermeta tutorial. How to create a metamodel. François Tanguy, Didier Vojtisek. Abstract


Introduction To Model-to-Model Transformation

Ant tasks for AMMA. Ant is an Apache project. It is open source software, and is released under the Apache Software License.

ATL: Atlas Transformation Language. ATL Transformation Description Template - version 0.1 -

Visualizing Software Architectures, Part 2

Transforming models with ATL

AMW: a tool for multi-level specification of model transformations

Sequence Diagram Generation with Model Transformation Technology

Introduction to MDE and Model Transformation

M. (1) (1) (2) (1) ATLAS

ATL Transformation. Catalogue of Model Transformations

ATL Demystified and an Introduction to the RPG2Petrinet Experiment

ECLIPSE MODELING PROJECT

ATL Transformation. Catalogue of Model Transformations

The Unified Modelling Language. Example Diagrams. Notation vs. Methodology. UML and Meta Modelling

ATL Transformation. Catalogue of Model Transformations

Grammars. Prof. Andreas Prinz. Introduction, Compilers. Examples Meta-models vs. Grammars Summary

MDD with OMG Standards MOF, OCL, QVT & Graph Transformations

Eclipse Development Tools for Epsilon

Introduction to OpenArchitectureWare

ATL Transformation Example

Introduction to EGF. Benoît Langlois / Thales Global Services.

Knowledge Discovery: How to Reverse-Engineer Legacy Systems

Using Model Driven Architecture to Manage Metadata

CISC836: Models in Software Development: Methods, Techniques and Tools

Model Querying with Graphical Notation of QVT Relations

Two Basic Correctness Properties for ATL Transformations: Executability and Coverage

A Metamodel independent approach for Conflict Detection to support distributed development in MDE. Mostafa Pordel A THESIS

Kermeta tutorial. How to create an EMF meta model? François Tanguy, Didier Vojtisek, Zoé Drey, Marie Gouyette. Abstract

Model Engineering Support for Tool Interoperability

It s all Done with Mirrors Patterns and OCL. KMF Kent Modelling Framework D.H.Akehurst and O.Patrascoiu

Model Transformations for Embedded System Design and Virtual Platforms

ATL TRANSFORMATION EXAMPLE

ATL Transformation Example

Model Driven Architecture Model Driven Development. Johann Oberleitner

Model Driven Engineering

Which Enterprise Architect Edition Should I Purchase?

An Open Modeling Infrastructure. Olaf Kath Marc Born

KM3: a DSL for Metamodel Specification

Start Up Benoît Langlois / Thales Global Services Eclipse (EMFT) EGF 2011 by Thales; made available under the EPL v1.

ATL Transformation. Catalogue of Model Transformations

Model-based Software Engineering (02341, spring 2017) Ekkart Kindler

ATL TRANSFORMATION EXAMPLE

BLU AGE 2009 Edition Agile Model Transformation

Rules and Helpers Dependencies in ATL Technical Report

An EMF Framework for Event-B

Introduction to Dependable Systems: Meta-modeling and modeldriven

ATL Transformation Example

Object Constraint Language (MDT OCL) 1.3 Galileo Simultaneous Release Review

Which Enterprise Architect Edition Should I Purchase?

with openarchitectureware

A Practical Approach to Bridging Domain Specific Languages with UML profiles

Modellierung operationaler Aspekte von Systemarchitekturen. Master Thesis presentation. October 2005 March Mirko Bleyh - Medieninformatik

CWM: Model Driven Architecture

INF5120 Model-Based System Development

Model handling with EMF

Specification and Automated Detection of Code Smells using OCL

Model driven Engineering & Model driven Architecture

Measuring Incrementally Developed Model Transformations Using Change Metrics

Quality Assessment of ATL Model Transformations using Metrics

QoS-aware model-driven SOA using SoaML

MDA Distilled Stephen J. Mellor Vice-President Project Technology, Inc.

Measuring ATL Transformations

16 Evaluation Framework for Model-Driven Product Line Engineering Tools

First experiments with the ATL model transformation language: Transforming XSLT into XQuery 1. Abstract

The TTC 2011 Reengineering Challenge Using MOLA and Higher-Order Transformations

Trace-Directed Modelling Mid-Project Meeting Report

A Comparison of Ecore and GOPPRR through an Information System Meta Modeling Approach

Eclipse technology in IFMS Interface Management System

This paper is more intended to set up a basis for a constructive discussion than to offer definitive answers and closed solutions.

ATL Transformation Example

EMF Europa Simultaneous Release

MDA Distilled Stephen J. Mellor Vice-President Project Technology, Inc.

Model-based Software Engineering (02341, spring 2016) Ekkart Kindler

Process DSL Transformation by Mappings Using Virtual Functional Views

Model-based Software Engineering (02341, spring 2017) Ekkart Kindler

dynamically typed languages Building Domain-Specific Languages for Model- Driven Development

Coral: A Metamodel Kernel for Transformation Engines

Orthographic Service Engineering

Composition Techniques for Rule-based Model Transformation Languages

"Families to Persons"

An AmmA/ATL Solution for the GraBaTs 2009 Reverse Engineering Case Study

Transcription:

ATL: ATLAS Transformation Language MISO - Uniandes 1

Models are first class entities Transformations are models Transformations are assets 2

What is ATL? ATL is a model transformation language (MTL) developed at INRIA to answer the QVT Request For Proposal. It is specified both as a metamodel and as a textual concrete syntax. It is a hybrid of declarative and imperative. 3

What is ATL? In declarative style: simple mappings can be expressed simply. Imperative constructs: are provided to express more complex mappings 4

What is ATL? An ATL transformation program is composed of rules that define: how source model elements are matched and navigated how to create and initialize the elements of the target models. 5

ATL and Ecore 6

ATL Transformation rules Input MM Input M Output MM ATL Engine Output M XMI XMI 7

Example module UML2JAVA; create OUT : JAVA from IN : UML ; module UML2Java.atl XMI UML MM UML M ATL Engine XMI M Java JAVA MM 8

Structure of an ATL transformation An ATL module corresponds to a model to model transformation. Elements: A header section: defines attributes that are relative to the transformation module; An optional import section: enables to import some existing ATL libraries A set of helpers: can be viewed as an ATL equivalent to Java methods A set of rules: defines the way target models are generated from source ones. 9

ATL modules They are the files that contain the transformations.atl extension Consist of: Header (mandatory) Import Helpers Rules 10

Import This section is optional Defines the ATL libraries to be imported Example: uses strings; 11

Header The target models declaration is introduced by the create keyword the source models are introduced either by the keyword from (in normal mode) or refines (in case of refining transformation) module module_name; create output_models [from refines] input_models; module Book2Publication; ; create OUT : Publication from IN: Book; output Metamodel input Metamodel 12

Helpers They are variables or functions used to implement code that can be reused helper def: objectidtype : Relational!Type = Class!DataType.allInstances()-> select(e e.name = 'Integer')->first(); Using a variable: type <- thismodule.objectidtype; 13

Helpers Using a function: helper context Book!Book def : getauthors() : String = self.chapters->collect(e e.author) ->asset()-> iterate(authorname; acc : String = '' acc + if acc = '' then authorname else ' and ' + authorname endif); Calling the function: b.getauthors() 14

Transformation Rules three different kinds of rules: matched rules (declarative programming) called rules (imperative programming). Lazy rules (?) 15

Matched Rules rule DataType2Type { from dt : Class!DataType to out : Relational!Type ( name <- dt.name ) } 16

Matched Rules rule DataType2Type { from dt : Class!DataType to out : Relational!Type ( name <- dt.name ) } Input Metamodel Output Metamodel 17

Matched Rules We need: To access any element of the input model To create elements of the output model from information of the elements of the input model The access to the elements is done using The OCL: Object Constraint language 18

Matched Rules: Input The input pattern consists of: the keyword from, the declaration of an input variable an OCL expression that returns the input element to be transformed from dt : Class!DataType 19

Matched Rules: Input (cont.) A filter is an OCL expression that restraints the elements of the input model to those that satisfy a set of constraints Example: Refer to the instances of the Parameter element in the UML Metamodel, where its kind is different from the value #pdk_eturn: e : UML!Parameter (e.kind <> #pdk_return) 20

Matched Rules: Output The output pattern declares: on which output elements of the output model, the input elements matching the input pattern will be transformed The implementation of the output pattern declares the details of the transformation It is possible to have more than one element in the output pattern 21

Matched Rules: Output (cont.) Declares a variable and a sequence of assignment statements. to out : Relational!Type ( name <- dt.name ) Building and instance of the element Type of the output model The name attribute of the new element will have as value the value of the name attribute of the element referenced by the variable dt 22

Called Rules They are a particular type of helpers They have to be explicitly called to be executed They can accept parameters. They can generate target model elements as matched rules do. A called rule has to be called from an imperative code section, either from a match rule or another called rule. 23

Called Rules rule NewPerson (na: String, s_na: String) { to p : MMPerson!Person ( name <- na ) do { p.surname <- s_na } } Generates Person target model elements. Accepts two parameters that correspond to the name and the surname of the Person The target pattern allocates a Person class each time the rule is called, and initializes the name attribute of the allocated model element. The imperative code section is executed after the initialization of the allocated element 24

Tranformation examples 1. ATL to Problem 2. Ant to Maven 3. BibTeXML to DocBook 4. Book to Publication 5. Class to Relational 6. Geometrical transformations Grafcet to PetriNet 7. Java to Table 8. KM3 to DOT 9. KM3 to Metrics 10. KM3 to Problem 11. Make to Ant 12. Maven to Ant 13. Microsoft Office Excel Extractor 14. Microsoft Office Excel Injector 16. Microsoft Office Excel to Software 17. Quality Control 18. Monitor to Semaphore 19. PathExp to PetriNet 20. Software Quality Control to Bugzilla 21. Software Quality Control to Mantis Bug Tracker 22. Table to Microsoft Office Excel 23. UML to Amble 24. UML to Java 25. UML to MOF 26. UML Activity Diagram to MSProject 27. UMLDI to SVG 28. XSLT to XQuery 25

UML2Java 26

UML MM expressed using MOF XMI <Model:Class xmi.id = 'a9' name = 'JavaElement' annotation = '' isroot = 'false' isleaf = 'false' isabstract = 'true' visibility = 'public_vis' issingleton = 'false'> <Model:Namespace.contents> <Model:Attribute xmi.id = 'a10' name = 'name' annotation = '' scope = 'instance_level' visibility = 'public_vis' ischangeable = 'true' isderived = 'false'> <Model:StructuralFeature.multiplicity> <XMI.field>1</XMI.field> <XMI.field>1</XMI.field> <XMI.field>true</XMI.field> <XMI.field>true</XMI.field> </Model:StructuralFeature.multiplicity> <Model:TypedElement.type> <Model:PrimitiveType xmi.idref = 'a6'/> </Model:TypedElement.type> </Model:Attribute> </Model:Namespace.contents> </Model:Class> 27

28

UML model in XMI <UML:Package xmi.id = 'sm$8809ce:fb81b88162:-7fe2' name = 'view' visibility = 'public' isspecification = 'false' isroot = 'false' isleaf = 'false' isabstract = 'false'> <UML:Namespace.ownedElement> <UML:Class xmi.id = 'sm$ec9b3a:fb81dfe2ed:-7ff7' name = 'BoundedIntegerView' visibility = 'public' isspecification = 'false' isroot = 'false' isleaf = 'false' isabstract = 'false' isactive = 'false'> <UML:Classifier.feature> <UML:Attribute xmi.id = 'sm$ec9b3a:fb81dfe2ed:-7fca' name = 'value' visibility = 'public' isspecification = 'false' ownerscope = 'instance' changeability = 'changeable'> 29

UML2Java: Transformation rules 1. For each Package element of UML MM create an element Package of Java MM The names have to be the same in the java case the name have be extended rule P2P { from e: UML!PAckage (e.oclistypeof (UML!Package)) to out : JAVA!Package ( name <- e.getextendedname() ) } 30

UML2Java: Transformation rules 2. For each Operation element of UML MM create an Method element of Java MM names, types, modifiers have to be the same 31

UML2Java: Transformation rules rule O2M { from e : UML!Operation to out : JAVA!Method ( name <- e.name, isstatic <- e.isstatic(), ispublic <- e.ispublic(), owner <- e.owner, type <- e.parameter-> select(x x.kind= #pdk_return)->assequence()->first().type, } parameters <- e.parameter->select(x x.kind<> #pdk_return)->assequence() ) 32

Transformation Engine Implemented in Java Can use EMF or MDR as model repository Input/output models and metamodelos are managed by the underlying model repository ATL has a proprietary repository to load the model transformations. 33

ATL Eclipse Plug-in There is a complete ATL perspective in Eclipse Also a perspective to Debug ATL transformations There are: an ATL editor an Ouline view to review the current elements 34

ATL Eclipse Plug-in 35

Referencias http://dev.eclipse.org/viewcvs/indextech.cgi/~ checkout~/gmthome/subprojects/atl/index.html http://www.sciences.univnantes.fr/lina/atl/atlproject 36