generating jmi model transformation code from uml profile ...€¦ · sdm gt specifications sdm gt...
TRANSCRIPT
GeneratingJMI model transformation code
from UML profile models for SDMAligning Graph Rewriting with MDA-light
Pieter Van GorpHans SchippersFormal Techniques in Software Engineering{Pieter.VanGorp,Hans.Schippers}@ua.ac.be
Segravis School on Foundations of Visual Modelling Techniques, May 2004, Schloss Dagstuhl
2/24
Overview
1. Demo 1:– Fujaba Refactoring Cycle– Refactoring Implementation¸ Pull Up Method
2. Problem: Tool Lock-In3. Solution: (Reflective) MDA Light4. Demo 2:
– Integrated Tool Context– Pull Up Method Refactoring¸ Pull Up Method
3/24
Fujaba Refactoring Cycle
Import Java Sources (by directory)
Rearrange diagrams
Execute Refactoring
New SourcesOld Sources
regenerate
parse1
2
3
4
4/24
Refactoring: Structural Design
Fujaba’s Metamodel Example Refactoring Classes
5/24
Refactoring Behavior: SDM
1. Bind method > (Hidden) Cast target
2. Bind container > Link Navigation
3. Bind stub > Link Navigation
4. Bind superclass > Link Navigation
5. Remove method from container
6. Add method to superclass
Model Transformation as Graph Transformation
6/24
Constraint Checking: SDM
[ failure]
[p1.getIndex()]
7/24
Overview
1. Demo 1:– Fujaba Refactoring Cycle– Refactoring Implementation¸ Pull Up Method
2. Problem: Tool Lock-In3. Solution: (Reflective) MDA Light4. Demo 2:
– Integrated Tool Context– Pull Up Method Refactoring¸ Pull Up Method
8/24
1. SDM could only be drawn in Fujabaß Industry Requires Commercial Support
2. Fujaba code generator assumes target repositorycomplies to Fujaba API.ß XMI + JMI + EMF + … desirable
Problem: Vendor Lock-In
9/24
1. SDM could only be drawn in Fujabaß Solution: UML Profile for SDM
2. Fujaba code generator assumes target repositorycomplies to Fujaba API.ß Solution: Pluggable Code Templates
Solution: Reflective MDA Light
Bézivin, J., Farcet, N., Jézéquel, J.-M., Langlois, B., Pollet, D. Reflective Model Driven Engineering. UML 2003, October, 2003
10/24
Reflective Architecture
11/24
Reflective Architecture (cont.)
12/24
Example “Fujaba vs JMI Specific Code”
JMI:// delete linkmethod.setOwner(null)// create linkmethod.setOwner(superclass);
13/24
Overview
1. Demo 1:– Fujaba Refactoring Cycle– Refactoring Implementation¸ Pull Up Method
2. Problem: Tool Lock-In3. Solution: (Reflective) MDA Light4. Demo 2:
– Integrated Tool Context– Pull Up Method Refactoring¸ Pull Up Method
14/24
Integrated Tool Context
Poseidon (or …):Transformation Specifications
SDM as UML 1.4 Profile
MM as Class Diagram
XMI
NetBeans MDR
Poseidon embedded MDR“Application” Models
JMI Manipulation + Poseidon Plugin Code
15/24
MM Class Diagram in PoseidonMetamodel Class Diagram
16/24
Transformation Component
SDM GT Specifications
SDM GT Specifications
SDM GT Specifications
Stereotypes as flags
17/24
High Level SDM Control Flow
18/24
Code Activity(demo purpose only)
19/24
Loop Activity(again with stereotype)
Use tagged value as reference
20/24
Path NavigationCreate Links
Remove Links
21/24
Attribute Assignments(demo purpose only)
22/24
Compiler Resultsÿ JMI Repository
Manipulation Code– View Updating through
small “hack”…
ÿ Poseidon Plugin– Extra menu item for
launching transformation
23/24
Conclusions (1/2)1. Now transformation writers can…ß Create visual model transformations in Magicdraw, Together,
Objecteering, Poseidon, …ß Execute them on JMI repositories (opt: CASE tool plugins)
2. Now, Fujaba can…ß be migrated to MDR
3. Now, other CASE tool vendors can…ß Provide a plugin for enhanced visualization (cfr. nesting)
24/24
Conclusions (2/2)ÿ Lessons Learned
– MDA Light¸ UML Profiles: adequate if MM close to UML¸ Code Templates: reuse problems
– Graph Rewriting¸Convenient for specifying Refactorings
ÿ Future Work– EMF support… if necessary, solve reuse problems with stepwise refinement– Model Refinement & Weaving Case Studies– Compare to (and align with) ATL
Publications– Pieter Van Gorp, Niels Van Eetvelde, and Dirk Janssens. Implementing Refactorings as Graph Rewrite Rules on a
Platform Independent Metamode. In Proceedings of the 1st International Fujaba Days. University of Kassel,Germany October 13-14, 2003.
– Hans Schippers. JMI Conforme Model Transformator Generator (JCMTG). Master Thesis, University of Antwerp,2004. Upcoming Paper...