Overview of ATL and ETL (Jouault and Kurtev 2006, ‘Transforming Models with ATL’, Proc. MODELS 2005 Workshops, LNCS, vol. 3844, pp Kolovos et al. 2006, ‘The Epsilon Object Language (EOL)’, Proc. ECMDA-FA 2006, LNCS, vol. 4066, pp Kolovos et al. 2008, ‘The Epsilon Transformation Language’, Proc. ICMT 2008, LNCS, vol. 5063, pp ) Presented by Matt Selway 1
Background of ATL 2 Hybrid declarative/imperative DSL for writing model- to-model transformations Started around 2004/5 by the ATLAS Group (later became AtlanMod) INRIA, University of Nantes Involved in the ModelWare IST European Project Builds on OCL, was submitted as a candidate for the OMG’s QVT standard Forms part of the ATLAS Model Management Architecture (AMMA), which supports wider model management such as model merging, comparison, etc.
Background of ETL 3 Hybrid declarative/imperative DSL for writing model- to-model transformations Started end of 2005 at Dpt. Comp. Science, University of York; also involved in the ModelWare project Part of the Epsilon framework, which supports general model management Task specific language built on EOL; an OCL like language for model navigation and modification Other Epsilon languages include: EVL, EGL, EWL, ECL, EML, and Flock
Feature Comparison 4 FeatureATLETL Directionalityunidirectional No. of modelsSource/Target1..n/1..n NavigabilitySource model(s)** Target model(s)-* ModifiabilityCreateTarget only* UpdateTarget only* DeleteOnly in refining mode* In-place transformation (model refactoring)* (refining mode)* Model Abstraction Layer** WorkflowANT Tasks “Helpers” (context)Meta-model Types** Primitive Types** Collection Types-* Context-less**
FeatureATLETL “Helpers” (type)Operations** Cached ResultsHelper attributesCached operations Modifiable PropertiesModule attributes only* ReuseHelper libraries** Rule libraries** Rule inheritance** Multiple inheritance* (in new VM)* Rule overriding* (superimposition)* RulesStandard** Lazy** (w/ operations) Unique lazy** (just lazy) Abstract** Greedy/Non-greedy* (non-greedy w/guards)* Primary-* No. source elements11 Feature Comparison 5
6 FeatureATLETL TraceabilityStandard** Lazy rules* (in new VM)- (can be hacked) Unique lazy** Multiple traces* (in new VM)* Inspectable Trace* (in new VM)* Exportable Trace* (in new VM)* Imperative featuresCalled rules** (EOL operations) Native called rules* (in new VM)* Action blocks** (entire rule body) Model Transactions-* User Interaction-* User-defined Datatypes-*
Execution Model (Both) 7 1.Execute pre-processing (imperative) 2.Match non-lazy (non-abstract) rules and generate target model elements (declarative) 3.Execute the rule bodies (in the context of the match and created model elements) (declarative/imperative) 4.Execute post-processing (imperative)
Syntax Comparison (Rule Structure) ATL Rules [abstract]? [[unique]? lazy]? rule [extends ]? { from : [in ]? [( )]? [using { : = ; [ : = ;]* }]? to : [in ]? ( bindings )[, : [in ]? ( binding )]* [do { statement+ }]? } [abstract]? [[unique]? lazy]? rule [extends ]? { from : [in ]? [( )]? [using { : = ; [ : = ;]* }]? to : [in ]? ( bindings )[, : [in ]? ( binding )]* [do { statement+ }]? } ETL Rules rule transform : to ( : (, : )* (extends (,)* )? { (guard (:expression)|({statement+}))? statement+ } rule transform : to ( : (, : )* (extends (,)* )? { (guard (:expression)|({statement+}))? statement+ } 8
Syntax Comparison (Concrete Example) ATL rule Class2Table { from class : OO!Class ( class.specialises.isUndefined()) to table : DB!Table ( name <- class.name, columns <- Sequence{pkColumn}, primaryKeys <- Sequence{pkColumn} ), pkColumn : DB!Column ( name <- class.name + ‘_pk’, type <- ‘INT’ ) } rule SingleValuedAttribute2Column from attribute : OO!Attribute ( not attribute.isMany) to column : DB!Column ( name <- attribute.name, table <- attribute.owner, type <- attribute.type ) } rule Class2Table { from class : OO!Class ( class.specialises.isUndefined()) to table : DB!Table ( name <- class.name, columns <- Sequence{pkColumn}, primaryKeys <- Sequence{pkColumn} ), pkColumn : DB!Column ( name <- class.name + ‘_pk’, type <- ‘INT’ ) } rule SingleValuedAttribute2Column from attribute : OO!Attribute ( not attribute.isMany) to column : DB!Column ( name <- attribute.name, table <- attribute.owner, type <- attribute.type ) } ETL rule Class2Table transform class : OO!Class to table : DB!Table, pkColumn : DB!Column { guard : class.specialises.isUndefined() table.name = class.name; table.columns.add(pkColumn); table.primaryKeys.add(pkColumn); pkColumn.name = class.name + ‘_pk’; pkColumn.type = ‘INT’; } rule SingleValuedAttribute2Column transform attribute : OO!Class to column : DB!Column { guard : not attribute.isMany column.name = attribute.name; column.table ::= attribute.owner; column.type = attribute.type; } rule Class2Table transform class : OO!Class to table : DB!Table, pkColumn : DB!Column { guard : class.specialises.isUndefined() table.name = class.name; table.columns.add(pkColumn); table.primaryKeys.add(pkColumn); pkColumn.name = class.name + ‘_pk’; pkColumn.type = ‘INT’; } rule SingleValuedAttribute2Column transform attribute : OO!Class to column : DB!Column { guard : not attribute.isMany column.name = attribute.name; column.table ::= attribute.owner; column.type = attribute.type; } 9
Pragmatics 10 Used both ATL and ETL, overall found ETL easier to use (although I was using ATL quite a while ago, so it may have improved since then) Couldn’t get ATL superimposition to work (not sure if they have fixed it yet) Transforming meta-models using ATL is finicky, ETL couldn’t care less; it treats all kinds of models much more uniformly Using multiple models in ATL was a bit of pain, easier to merge all the (meta-)models into a single one to make life easier ATL almost forces you to do things declaratively, a number of its imperative features have awkward limitations; therefore, in complex transformations you end up doing weird workarounds ETL makes it much easier to use imperative constructs, sometimes too easy, but found that complex transformations need them ETL’s use of ‘=‘ for primitive types and ‘::=‘ for automatic resolution of model types can be a pain, if you use the wrong one you don’t get an error, just an empty result.