SlideShare a Scribd company logo
1 of 23
Download to read offline
MoScript: A DSL for querying and
     manipulating model repositories

   Wolfgang Kling
   Frédéric Jouault         Marco Brambilla                                                      Dennis Wagelaar
     Jordi Cabot




21/11/11              ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                   1
Context

  Large numbers of modelling artefacts
    –  E.g. MDD phases consume and produce
       models
               Requirements
                              Use Case

                                                                    Class Diagram

                                                                                                           Java Project



                               Transfo
                                      rma-on
                                            s	
  

  Stored in model repositories
  Strong interrelations

21/11/11	
                      ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                    2	
  
Context

  Not only models (source code,
                                                                                            0110010
                                                                                            1010100
                                                                                              01100101
                                                                                            1010010
                                                                                              01010010
                                                                                            1010001
                                                                                              10010101
   tools, libraries etc.)                                                                     0001101	
  



  Heterogeneous
  Distributed
  Constant evolution of the
   repository


                                                                        01100101
                                                                        01010010
                                                                        10010101
                                                                        00011010
                                                                        001	
  


21/11/11	
       ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                     3	
  
Motivation

  Understand repository (updated view)                                                                  0100101
                                                                                                         0100010
                                                                                                         1010




  Finding models
    –  By their content
    –  By a computed characteristic                                                                                          ?
    –  By their relation with other
       models

  Combining models
   information

  Perform common modelling                                              010010                 010010
                                                                                                                   010010
                                                                                                                   101000
                                                                                                                   101010




   tasks batch processing
                                                                         101000                 101000
                                                                         101010                 101010




  21/11/11	
         ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                                 4	
  
MoScript

A textual DSL for querying and manipulating
model repositories
  Retrieve models
    –  by structure and content
    –  by their relations with others
    –  by behaviour (after a simulation)
  Manipulate models (transform, match,
   compare etc.) right after finding them
  Update repository view, persisting newly
   created artefacts or discarding existing ones

21/11/11	
        ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     5	
  
MoScript

  Based on the megamodel (repository view)
  Uses OCL
  Combines OCL with
   –  Operations without side effects
   –  Statements (update view and repository)




21/11/11	
       ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     6	
  
MoScript	
  and	
  the	
  Megamodel	
  

                               MoScript	
  

               Megamodel




                    011              011                                                         011
                    001              001                                                         001




                            Model Repositories
21/11/11	
                     ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     7
Megamodel’s Metamodel

                                                                                                                                               * target
                                                                                                                                 Identified    * source
                                            Entity
                                                                                                                                  Element
                                                                                                                                               * linked


                                  *                              * elements
                                  *         Model                                                                               Relationship   * relatedTo


                 conformsTo 1
                   *
                            Reference                                 Terminal                                                                 * sourceOf
                   *                                                                                                             Directed
                             Model                                     Model
                                                                                                                                Relationship
                                                                                                                                               * targetOf
               extends *

                   MetaMeta                     Weaving            1
                    Model                        Model Transformation
                                MetaModel
                                                           Model      Mega                                                                           Transformation
                                                                                                                           Transformation
                                                                      Model                                                                              Record
               targetReferenceModel
         srcReferenceModel
      targetModel
     srcModel



21/11/11	
                                           ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                                           8	
  
So far … (OCL and Megamodel)

  Models conforming to the Java metamodel
         Model::allInstances()−>select(m | m.conformsTo.kind = ’Java’)"


                              Collection{ Model1, Model2 …, Modeln }"


  Transformations that transform models
   conforming to the Java metamodel
         Transformation::allInstances()"
            "−>select(t | t.srcReferenceModels.exists(rm | rm.kind = ’Java’))"



                 Collection{ Transformation1, Transformation2 …, Transformationn }"



21/11/11	
                           ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     9	
  
Strategy




                                                                                             t (x)=	
  y	
  
Synchronize	
  
                                                              x	
  




21/11/11	
        ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                       10	
  
MoScript Abstract Syntax

                                           OCL                                                                       MoScript                     MoScript
                         OclExpression

                                                                                                                         Unit



                         PropertyCallExp
                                                                              Helper                                   Library                     Program



                     OperationCallExp
                                                                                 ExpressionStat                                               Statement




               QueryOp                ProjectionOp           RegisterStat                                  SaveStat                            ForStat



                          TransformOp           StateCheckOp                       RemoveStat                                   BindingStat               IfStat



21/11/11	
                                           ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
                                        11	
  
MoScript Concrete Syntax
       program program_name"

       uses library1"
       uses …"

       [ using {"
           "variable1 : type = OclExpr;"
           "variable2 …"
       }]"

       do {"
               "variable <- OclExpr;"

               "save(OclExpr, …);"
               "remove(OclExpr, …);"

               "register(…);"

               "if …"
               "for …"
       }"

       helper …"

21/11/11	
                              ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     12	
  
Brief Examples

  Query operations
      Model::allInstances()−>any(m | m.indentifier = ’SimpsonFamily’)
         "                 −>allContents()−>collect(el | el.name))"


                    Collection {’Bart’, ’Homer’, ’Lisa’, ’Maggie’, ’Marge’} "

  Model to Model transformations (M2M)
      1" let j2dNet : Transformation = Transformation::allInstances()"
      2"    "−>any(t | t.identifier = ’j2dNet’)"
      3" in"
      4"
      5" Model::allInstances()"
      6"    "−>select(m | m.conformsTo.kind = ’Java’)) "
      7"    "−>collect (jModel | j2dNet.applyTo(jModel))"


      TransformationRecord::allInstances()−>collect(tr | tr.run())"
21/11/11	
                       ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     13	
  
Brief Examples

  Projectors (inject & extract)
      Model::allInstances()−>select(m | m.conformsTo.kind = ’JavaGrammar’)) "
         "−>collect (jCode|jCode.inject())"



  The save statement
      1" ... for(dNetModel in dNetModels) {"
      2"    "   "save( dNetModel, dNetModel.getIdentifier(),"
      3"                dNetModel . location + ’.xmi’);"
      4"      } "
      5"
      6" helper context Model def: getIdentifier(): ... ;"


  The register statement"
      register(MetaMetaModel, ’Ecore’, ’http://www.eclipse.org/emf/2002/Ecore’);"

21/11/11	
                      ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     14	
  
MoScript

                          Operations Without Side Effects
  Model :: allContents() : Collection(OclAny)"

  Model :: allContentsRoots() : Collection(OclAny)"

  Model :: allContentsInstancesOf(type_name : String) : Collection(OclAny)"

  Model :: allContentsInstancesOf(type : OclAny) : Collection(OclAny)"

  Transformation :: applyTo(inputModels : Sequence(Model)) : TransformationRecord"

  Transformation :: applyTo(inputModels : Map(String, Model)) : TransformationRecord"

  TransformationRecord :: run() : TransformationRecord"

  Model :: inject() : Model"

  Model :: extract() : Model"

  Model :: available() : Boolean"

  Model :: isDirty() : Boolean"



21/11/11	
                      ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     15	
  
MoScript

                        Statements With Side Effects
  save(m : Model, mgm : Megamodel, id : String, locator : String)"
  remove(m : Model, mgm : Megamodel)"
  register(elem : OclModelElement, id : String, locator : String)"
  register(elem : OclModelElement, attrs : Map(String, OclAny))"




21/11/11	
                 ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     16	
  
MoScript	
  Underlying	
  
                  DSLs	
  
                 Editors	
  
               Discoverers	
        1
                                                                        Architecture	
  
                                        MoScript	
  
                           2
                                    3                      6
       Megamodel
                                                                            5
                                 Metadata	
  Engine	
                                      TransformaIon	
  
                                                                                                Tools	
  

                                                        4



                     011                      011                                                         011
                     001                      001                                                         001




                                 Model Repositories
21/11/11	
                          ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
      17
ImplementaIon	
  
                                                 MoScript	
  
                                                   ATL	
  VM	
  
               GMM / AM3
                                                                                                        ATL
                                                                                                       ATL VM
                                                      AM3
                                                                                                        TCS
                                                                                                       ANTLR



                  ATL Zoo                     WebML
                                                         011                                             011
                    011                                                                                  001
                                                         001
                    001




                                       Model Repositories
21/11/11	
                  ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
              18
Eclipse plugin




21/11/11	
     ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     19	
  
Experimentation
  ATL Transformation Zoo model repository
       http://www.eclipse.org/m2m/atl/atlTransformations/

          –  205 metamodels, 275 models, 219 transformations and
             400 other artefacts

      Reverse engineering megamodel generation
      Different kind of metrics
      Execution of all the transformations and check results
      Matching models

  WebML model repository
   –  WebModel metamodel
   –  WebModel xml (.wr) injection to ecore
   –  Transformation to WebML models
   –  Count user interface fields
21/11/11	
                               ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     20	
  
Conclusions

DSL for querying and manipulating model repositories
•  Uses OCL
•  Based on the Megamodel
•  Model dereferencing
•  Applies transformation to model similarly as working
   with functions.
•  Allows the use of multiple transformation tools
•  Makes types checking at run time to ensure
   consistency.
•  Hides a lot of the complexity of handling large
   amounts of modelling artefacts and relationships, to
   the user
•  Keeps synchronized the megamodel with the
   repository to ensure integrity

21/11/11	
          ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     21	
  
END




               Thank you
                  for
               attending

21/11/11	
      ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     22	
  
ATL Transformations Zoo




21/11/11	
           ©	
  AtlanMod	
  	
  -­‐	
  	
  atlanmod-­‐contact@mines-­‐nantes.fr	
     23	
  

More Related Content

Viewers also liked

Viewers also liked (6)

MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
 
Prototyping is an attitude
Prototyping is an attitudePrototyping is an attitude
Prototyping is an attitude
 
10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
 
How to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media PlanHow to Build a Dynamic Social Media Plan
How to Build a Dynamic Social Media Plan
 
Learn BEM: CSS Naming Convention
Learn BEM: CSS Naming ConventionLearn BEM: CSS Naming Convention
Learn BEM: CSS Naming Convention
 
SEO: Getting Personal
SEO: Getting PersonalSEO: Getting Personal
SEO: Getting Personal
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

MoScript a textual DSL for model manipulations

  • 1. MoScript: A DSL for querying and manipulating model repositories Wolfgang Kling Frédéric Jouault Marco Brambilla Dennis Wagelaar Jordi Cabot 21/11/11 ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   1
  • 2. Context   Large numbers of modelling artefacts –  E.g. MDD phases consume and produce models Requirements Use Case Class Diagram Java Project Transfo rma-on s     Stored in model repositories   Strong interrelations 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   2  
  • 3. Context   Not only models (source code, 0110010 1010100 01100101 1010010 01010010 1010001 10010101 tools, libraries etc.) 0001101     Heterogeneous   Distributed   Constant evolution of the repository 01100101 01010010 10010101 00011010 001   21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   3  
  • 4. Motivation   Understand repository (updated view) 0100101 0100010 1010   Finding models –  By their content –  By a computed characteristic ? –  By their relation with other models   Combining models information   Perform common modelling 010010 010010 010010 101000 101010 tasks batch processing 101000 101000 101010 101010 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   4  
  • 5. MoScript A textual DSL for querying and manipulating model repositories   Retrieve models –  by structure and content –  by their relations with others –  by behaviour (after a simulation)   Manipulate models (transform, match, compare etc.) right after finding them   Update repository view, persisting newly created artefacts or discarding existing ones 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   5  
  • 6. MoScript   Based on the megamodel (repository view)   Uses OCL   Combines OCL with –  Operations without side effects –  Statements (update view and repository) 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   6  
  • 7. MoScript  and  the  Megamodel   MoScript   Megamodel 011 011 011 001 001 001 Model Repositories 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   7
  • 8. Megamodel’s Metamodel * target Identified * source Entity Element * linked * * elements * Model Relationship * relatedTo conformsTo 1 * Reference Terminal * sourceOf * Directed Model Model Relationship * targetOf extends * MetaMeta Weaving 1 Model Model Transformation MetaModel Model Mega Transformation Transformation Model Record targetReferenceModel srcReferenceModel targetModel srcModel 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   8  
  • 9. So far … (OCL and Megamodel)   Models conforming to the Java metamodel Model::allInstances()−>select(m | m.conformsTo.kind = ’Java’)" Collection{ Model1, Model2 …, Modeln }"   Transformations that transform models conforming to the Java metamodel Transformation::allInstances()" "−>select(t | t.srcReferenceModels.exists(rm | rm.kind = ’Java’))" Collection{ Transformation1, Transformation2 …, Transformationn }" 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   9  
  • 10. Strategy t (x)=  y   Synchronize   x   21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   10  
  • 11. MoScript Abstract Syntax OCL MoScript MoScript OclExpression Unit PropertyCallExp Helper Library Program OperationCallExp ExpressionStat Statement QueryOp ProjectionOp RegisterStat SaveStat ForStat TransformOp StateCheckOp RemoveStat BindingStat IfStat 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   11  
  • 12. MoScript Concrete Syntax program program_name" uses library1" uses …" [ using {" "variable1 : type = OclExpr;" "variable2 …" }]" do {" "variable <- OclExpr;" "save(OclExpr, …);" "remove(OclExpr, …);" "register(…);" "if …" "for …" }" helper …" 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   12  
  • 13. Brief Examples   Query operations Model::allInstances()−>any(m | m.indentifier = ’SimpsonFamily’) " −>allContents()−>collect(el | el.name))" Collection {’Bart’, ’Homer’, ’Lisa’, ’Maggie’, ’Marge’} "   Model to Model transformations (M2M) 1" let j2dNet : Transformation = Transformation::allInstances()" 2" "−>any(t | t.identifier = ’j2dNet’)" 3" in" 4" 5" Model::allInstances()" 6" "−>select(m | m.conformsTo.kind = ’Java’)) " 7" "−>collect (jModel | j2dNet.applyTo(jModel))" TransformationRecord::allInstances()−>collect(tr | tr.run())" 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   13  
  • 14. Brief Examples   Projectors (inject & extract) Model::allInstances()−>select(m | m.conformsTo.kind = ’JavaGrammar’)) " "−>collect (jCode|jCode.inject())"   The save statement 1" ... for(dNetModel in dNetModels) {" 2" " "save( dNetModel, dNetModel.getIdentifier()," 3" dNetModel . location + ’.xmi’);" 4" } " 5" 6" helper context Model def: getIdentifier(): ... ;"   The register statement" register(MetaMetaModel, ’Ecore’, ’http://www.eclipse.org/emf/2002/Ecore’);" 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   14  
  • 15. MoScript Operations Without Side Effects Model :: allContents() : Collection(OclAny)" Model :: allContentsRoots() : Collection(OclAny)" Model :: allContentsInstancesOf(type_name : String) : Collection(OclAny)" Model :: allContentsInstancesOf(type : OclAny) : Collection(OclAny)" Transformation :: applyTo(inputModels : Sequence(Model)) : TransformationRecord" Transformation :: applyTo(inputModels : Map(String, Model)) : TransformationRecord" TransformationRecord :: run() : TransformationRecord" Model :: inject() : Model" Model :: extract() : Model" Model :: available() : Boolean" Model :: isDirty() : Boolean" 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   15  
  • 16. MoScript Statements With Side Effects save(m : Model, mgm : Megamodel, id : String, locator : String)" remove(m : Model, mgm : Megamodel)" register(elem : OclModelElement, id : String, locator : String)" register(elem : OclModelElement, attrs : Map(String, OclAny))" 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   16  
  • 17. MoScript  Underlying   DSLs   Editors   Discoverers   1 Architecture   MoScript   2 3 6 Megamodel 5 Metadata  Engine   TransformaIon   Tools   4 011 011 011 001 001 001 Model Repositories 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   17
  • 18. ImplementaIon   MoScript   ATL  VM   GMM / AM3 ATL ATL VM AM3 TCS ANTLR ATL Zoo WebML 011 011 011 001 001 001 Model Repositories 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   18
  • 19. Eclipse plugin 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   19  
  • 20. Experimentation   ATL Transformation Zoo model repository http://www.eclipse.org/m2m/atl/atlTransformations/ –  205 metamodels, 275 models, 219 transformations and 400 other artefacts   Reverse engineering megamodel generation   Different kind of metrics   Execution of all the transformations and check results   Matching models   WebML model repository –  WebModel metamodel –  WebModel xml (.wr) injection to ecore –  Transformation to WebML models –  Count user interface fields 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   20  
  • 21. Conclusions DSL for querying and manipulating model repositories •  Uses OCL •  Based on the Megamodel •  Model dereferencing •  Applies transformation to model similarly as working with functions. •  Allows the use of multiple transformation tools •  Makes types checking at run time to ensure consistency. •  Hides a lot of the complexity of handling large amounts of modelling artefacts and relationships, to the user •  Keeps synchronized the megamodel with the repository to ensure integrity 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   21  
  • 22. END Thank you for attending 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   22  
  • 23. ATL Transformations Zoo 21/11/11   ©  AtlanMod    -­‐    atlanmod-­‐contact@mines-­‐nantes.fr   23