Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT...
Transcript of Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT...
![Page 1: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/1.jpg)
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
![Page 2: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/2.jpg)
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
![Page 3: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/3.jpg)
3/24
Fujaba Refactoring Cycle
Import Java Sources (by directory)
Rearrange diagrams
Execute Refactoring
New SourcesOld Sources
regenerate
parse1
2
3
4
![Page 4: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/4.jpg)
4/24
Refactoring: Structural Design
Fujaba’s Metamodel Example Refactoring Classes
![Page 5: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/5.jpg)
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
![Page 6: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/6.jpg)
6/24
Constraint Checking: SDM
[ failure]
[p1.getIndex()]
![Page 7: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/7.jpg)
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
![Page 8: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/8.jpg)
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
![Page 9: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/9.jpg)
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
![Page 10: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/10.jpg)
10/24
Reflective Architecture
![Page 11: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/11.jpg)
11/24
Reflective Architecture (cont.)
![Page 12: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/12.jpg)
12/24
Example “Fujaba vs JMI Specific Code”
JMI:// delete linkmethod.setOwner(null)// create linkmethod.setOwner(superclass);
![Page 13: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/13.jpg)
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
![Page 14: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/14.jpg)
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
![Page 15: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/15.jpg)
15/24
MM Class Diagram in PoseidonMetamodel Class Diagram
![Page 16: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/16.jpg)
16/24
Transformation Component
SDM GT Specifications
SDM GT Specifications
SDM GT Specifications
Stereotypes as flags
![Page 17: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/17.jpg)
17/24
High Level SDM Control Flow
![Page 18: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/18.jpg)
18/24
Code Activity(demo purpose only)
![Page 19: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/19.jpg)
19/24
Loop Activity(again with stereotype)
Use tagged value as reference
![Page 20: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/20.jpg)
20/24
Path NavigationCreate Links
Remove Links
![Page 21: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/21.jpg)
21/24
Attribute Assignments(demo purpose only)
![Page 22: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/22.jpg)
22/24
Compiler Resultsÿ JMI Repository
Manipulation Code– View Updating through
small “hack”…
ÿ Poseidon Plugin– Extra menu item for
launching transformation
![Page 23: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/23.jpg)
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)
![Page 24: Generating JMI model transformation code from UML profile ...€¦ · SDM GT Specifications SDM GT Specifications SDM GT Specifications Stereotypes as flags. 17/24 High Level SDM](https://reader035.fdocuments.in/reader035/viewer/2022081400/5f16ca3d6f473758e57ab20f/html5/thumbnails/24.jpg)
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...