1 / 15

Bi-directional Transformation for DSMLs and Code

Bi-directional Transformation for DSMLs and Code. Michal Antkiewicz , Krzysztof Czarnecki , Zinovy Diskin , Herman Lee, Matthew Stephan. Framework-Specific Modeling Languages (FSMLs). FSMLs = DSMLs for framework APIs Used to express Framework Specific Models (FSMs) Use cases

hugh
Download Presentation

Bi-directional Transformation for DSMLs and Code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bi-directional Transformation for DSMLs and Code Michal Antkiewicz, Krzysztof Czarnecki, ZinovyDiskin, Herman Lee, Matthew Stephan

  2. Framework-Specific Modeling Languages (FSMLs) • FSMLs = DSMLs for framework APIs • Used to expressFramework Specific Models (FSMs) • Use cases • Understand API • Understand and check application code (reverse eng.) • Generate application code (forward eng.) • Evolve application (round-trip eng.) • Migration application code to new API

  3. ◄models provides APIconcepts& constraints describes API concepts as feature models + encodes API constraints FSML Framework API * * * 1 ▲ ▲ uses conforms to * * ◄models API usage Application FSM implements concept instances describes conceptinstances as feature configurations 1 * * * ◄corresponds to► Featureinstance Codepattern * * entityrole entity contents of an entity relationship

  4. [0..*] Applet [1] Applet [1] name (‘sun.WireFrame.ThreeD’) ![1] extendsApplet [0..*] parameter [1] parameter [1] name (‘model’) [1] parameter [1] name (‘scale’) [1] listensToMouse ![1] implementsMouseListener ![1] registers [1] deregisters [1] deregistersSameObject [1] registersBeforeDeregisters framework-specific model application code

  5. [0..*] Applet [1] name (String) ![1] extendsApplet [0..*] parameter [0..1] name (String) [0..1] listensToMouse ![1] implementsMouseListener ![1] registers [1] deregisters [1] deregistersSameObject [1] registersBeforeDeregisters <class> <fullyQualifiedName> <assignableTo: ‘Applet’> <callsReceived: ‘getParameter(String)’> <valueOfArg: 1> <callsReceived: ‘addMouseListener(Mous[…])’> <callsReceived: ‘removeMouseListener(M[…])’> <argument:1 of call: ../../registers sameAsArg: 1 of call: ../../deregisters> <methodCall: ../../../registers before: ../..> Framework-Specific Modeling Language FSML syntax mapping to code

  6. Mapping definition and implementation • Mapping (relation spec) defined by mapping types • Structural and behavioural mapping types • Behavioural mapping types are pointcuts (e.g., cflow, dflow) • Each mapping type has by default • Code query (get) • Code transformation (put)

  7. Queries and trafos • Approximations of behavioural mapping types • Precision and recall for queries • Potentially partial implementation by transformations • Refinements through additional parameters for queries and transformations • Query – different precision • Trafo – e.g., additional control over location of additions

  8. Java Applet FSML Java code using Applet framework Applet- specific model

  9. r = S MS M ΔS ΔMS ΔM r m get put cmp S’ M’S M’ ΔS’ ΔM’S ΔM’ rec r = S’’ M’’S M’’

  10. Update Reconciliation • Three way compare • Recursive over containment structure • Use id defined based on code properties (key definitions) • Different types of conflicts • Review and propagate

  11. Update Reconciliation

  12. Characterization • Bidirectional DSLs for different artifact types to defining lenses • Get and put given by mapping • Mapping defined compositionally (over the metamodel) • New mapping types can be added

  13. Future Work • Code removal and update • More stable ids for code • Formalization of the approach

More Related