Your SlideShare is downloading. ×
  • Like
  • Save
Eugenia
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Eugenia

  • 18,916 views
Published

EuGENia is a tool that automatically generates the .gmfgraph, .gmftool and .gmfmap models needed to implement a GMF editor from a single annotated Ecore metamodel. EuGENia provides high-level …

EuGENia is a tool that automatically generates the .gmfgraph, .gmftool and .gmfmap models needed to implement a GMF editor from a single annotated Ecore metamodel. EuGENia provides high-level annotations that shield you from the complexity of GMF and lowers the entrance barrier for creating your first GMF editor. While EuGENia is very useful for getting started with GMF, it doesn't stop there and can be used all the way to the final polished version of your editor.

Published in Technology , Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
18,916
On SlideShare
0
From Embeds
0
Number of Embeds
16

Actions

Shares
Downloads
3
Comments
0
Likes
4

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Filesystem contains drives, Drives contain folders and files, Folders contain folders and files. Shortcuts are special types of files that point at another file and Sync show synchronization relationships between files/folders.
  • EMF can generate a Java implementation of our metamodel that supports serialization + de-serialization to XMI, and a basic tree-based model editor
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • The tooling model specifies the tools (captions, icons and categorization) in the editor palette.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • The graph model specifies the figures and lines involved in the editor – without specifying which concepts of the metamodel these figures represent.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • You can’t really blame the wizard as it has very little information at its disposal.
  • Since the wizard cannot produce anything useful, we need to hand-craft the mapping model. The mapping model is responsible for establishing mappings between the tools of the tool model, the figures of the graph model and the concepts of the metamodel.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.
  • The graph model specifies the figures and lines involved in the editor – without specifying which concepts of the metamodel these figures represent.
  • GMF builds atop EMF and requires us to specify a few more models so that it can generate a diagram-based editor for our metamodel.

Transcript

  • 1. EuGENia: GMF for mortals
    Dimitris Kolovos, Louis Rose, Richard Paige
    {dkolovos, louis, paige}@cs.york.ac.uk
    @dskolovos, @louismrose, @richpaige
    Department of Computer Science
    University of York
  • 2. Aim: Implement a graphical
    editor for a DSL
  • 3. Technologies: Eclipse, EMF, GMF
  • 4. Our Metamodel (in EMF/Ecore)
  • 5. How EMF Works
  • 6. How GMF Works
    Meta
    Model
  • 7. How GMF Works
    Meta
    Model
  • 8. The GMF Tooling Model
  • 9. How GMF Works
    Meta
    Model
  • 10. The GMF Graph Model
  • 11. How GMF Works
    Meta
    Model
  • 12. Mapping Model Wizard
  • 13. The GMF Mapping Model
  • 14. How GMF Works
    Meta
    Model
  • 15. The Generator Model
  • 16. How GMF Works
    Meta
    Model
  • 17.
  • 18. Powerful
  • 19. Configurable
  • 20. Labour intensive
  • 21. Hard to master
  • 22. Error prone
  • 23. Replace it
    Make it easier
  • 24. EuGENia
  • 25. How EuGENia Works
  • 26. Our Metamodel
  • 27. Our Metamodel (in Emfatic)
  • 28. Our annotated metamodel
  • 29. A closer look…
  • 30. Filesystem
    @gmf.diagram
    class Filesystem {
    val Drive[*] drives;
    val Sync[*] syncs;
    }
  • 31. File
    @gmf.node(label=“name”)
    class File {
    attr String name;
    }
  • 32. Shortcut
    @gmf.node(label=“name”)
    class Shortcut extends File {
    attr String name;
    @gmf.link(target.decoration="arrow",
    style="dash")
    ref File target;
    }
  • 33. Folder
    @gmf.node(label=“name”)
    class Folder extends File {
    attr String name;
    @gmf.compartment
    val File[*] contents;
    }
  • 34. Drive
    @gmf.node(label=“name”)
    class Drive extends Folder {
    attr String name;
    @gmf.compartment
    val File[*] contents;
    }
  • 35. Sync
    @gmf.link(label="lastSync", source="source",
    target="target", style="dot", width="2")
    class Sync {
    ref File source;
    ref File target;
    attr String lastSync;
    }
  • 36. How EuGENia Works
  • 37. Customize it!
  • 38. Polishing your Editor
    Add EOL scripts next to your metamodel to customize the produced GMF models
    ECore2GMF.eol <- .gmfgraph, .gmftool, .gmfmap
    FixGMFGen.eol <- .gmfgen
    EuGENia picks them up and runs them after the built-in transformations
    www.eclipse.org/gmt/epsilon/doc/articles/eugenia-polishing
  • 39. Polishing Example
    // Set Shortcut’s label font to italic
    varshortcutLabel = GmfGraph!Label.all.
    selectOne(lbl | lbl.name = "ShortcutLabelFigure");
    shortcutLabel.font = createItalicFont();
    operationcreateItalicFont() {
    var font = new GmfGraph!BasicFont;
    font.style = GmfGraph!FontStyle#ITALIC;
    return font;
    }
  • 40. More features
    Custom Java figures
    Internal/external/composite labels
    Affixed nodes
    Phantom nodes
    Combined diagram/model file
    Model/diagram extension
    Copyright text (in separate copyright.txt file)
  • 41. Good stuff
    Easy
    High level
    Hides GMF details
    Change resilient
    Can target different editor frameworks in the future
    Further customization with EOL
    www.eclipse.org/gmt/epsilon/doc/articles/eugenia-polishing
  • 42. Not so good stuff
    Not 1:1 GMF mapping
    By construction
    Polishing compensates for this
    Pollutes metamodel
    Trade-off for usability
  • 43. Implementation Notes
    2 Model-to-Model Transformations
    1235 Lines of Code
    Transformations in EOL
    Epsilon Object Language (≈ JavaScript + OCL) www.eclipse.org/gmt/epsilon/doc/eol
    Try EOL in your browserwww.eclipse.org/gmt/epsilon/live
  • 44. Community
    Well-received contribution
    Forum activity
    http://www.eclipse.org/gmt/epsilon/forum
    Requests for enhancements
    #265145, #265285, #265609, #268085, #285912 …
    Comments in Epsilon’s blog
    http://epsilonblog.wordpress.com
  • 45. Resources
    Download
    www.eclipse.org/gmt/epsilon
    Tutorial (+ list of annotations)
    www.eclipse.org/gmt/epsilon/doc/eugenia
    Examples
    www.eclipse.org/gmt/epsilon/examples
    Screencasts
    www.eclipse.org/gmt/epsilon/cinema
    Follow Epsilon on Twitter @epsilonews