Picto: Model Visualisation
via M2T Transformation
Dimitris Kolovos
dimitris.kolovos@york.ac.uk
Textual vs. Graphical Syntax
• Choice that needs to
be made when
implementing a DSL
• Textual: Xtext, Spoofax,
MPS
• Graphical: Sirius,
GMF/Eugenia,
MetaEdit+
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
25/11/2019 Enterprise Systems Seminars 2
Graphical Syntax
+Taps into the power of
the visual system
• Visual representations
processed in parallel
+Essential for
engagement with non-
CS stakeholders
- Only editable with a
dedicated editor
- Find, replace, copy,
paste, comment out,
version control not
always straightforward
25/11/2019 Enterprise Systems Seminars 3
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
25/11/2019 Enterprise Systems Seminars 4
Textual Syntax
+Editable with any text
editor
+Find, replace, copy,
paste, comment out,
version control
practically solved
- Text processed serially
by the auditory system
- Inaccessible to many
non-CS stakeholders
25/11/2019 Enterprise Systems Seminars 5
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
Textual vs. Graphical Syntax
• Text better for editing
• Once you are familiar
with the DSL and in the
zone
• Even for languages
which are traditionally
graph-like (e.g. state
machines)
• Diagrams better for
understanding and
presenting models to a
wider audience
25/11/2019 Enterprise Systems Seminars 6
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
Multiple Syntaxes
• Implement a graphical
and a textual editor
• Edit on both sides and
keep in sync
• Challenging in practice
• Graphical/textual
frameworks developed
by different vendors
• Lots of plumbing
involved
• A few prototypes but
cutting many corners
25/11/2019 Enterprise Systems Seminars 7
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
Graphical Views
• Textual syntax for
editing models
• Generation of read-
only graphical views
• Challenges
• Diagram layout
• Fine-tuning (e.g. size,
colour of
elements/labels)
25/11/2019 Enterprise Systems Seminars 8
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
Layout
• Several decent options
for automated graph
layout e.g.
• Graphviz
• Eclipse Layout Kernel
• DagreJS
• Important that
diagrams are kept
reasonably small
• But this is desirable
anyway
25/11/2019 Enterprise Systems Seminars 9
User -> ATM: Inserts card
ATM --> User: Requests PIN
User -> ATM: Provides PIN
ATM -> Bank: Check PIN against card
Bank --> ATM: Accepts PIN
ATM --> User: Asks for type of transaction
Fine-Tuning
public static void main(String[] args){
System.out.println("Hello world");
}
25/11/2019 Enterprise Systems Seminars 10
Fine-Tuning
public static void main(String[] args){
System.out.println("Helloworld");
}
25/11/2019 Enterprise Systems Seminars 11
Flexmi and Picto
• Flexmi: XML-based syntax for EMF models
• Reflective and fuzzy parsing
• Instantiable model element templates
• Presented in a previous ES Seminar
• Picto: Framework for model view generation and
rendering
• EMF models (for now)
• Views in Graphviz, SVG, HTML
• Views generated using M2T transformations (in EGL)
• Both tools in the latest interim version of Epsilon
(eclipse.org/epsilon)
25/11/2019 Enterprise Systems Seminars 12
Live demo
25/11/2019 Enterprise Systems Seminars 13
Picto – Future Work
• Layers
• Declarative graphical syntax specification
• Similar to Sirius/GMF/Eugenia
• Navigation from view to model editor
• Generation of views from multiple models
• Integration with model validation
• Change visualization
• Web application
25/11/2019 Enterprise Systems Seminars 14

Picto: Model Visualisation via M2T Transformation

  • 1.
    Picto: Model Visualisation viaM2T Transformation Dimitris Kolovos dimitris.kolovos@york.ac.uk
  • 2.
    Textual vs. GraphicalSyntax • Choice that needs to be made when implementing a DSL • Textual: Xtext, Spoofax, MPS • Graphical: Sirius, GMF/Eugenia, MetaEdit+ User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction 25/11/2019 Enterprise Systems Seminars 2
  • 3.
    Graphical Syntax +Taps intothe power of the visual system • Visual representations processed in parallel +Essential for engagement with non- CS stakeholders - Only editable with a dedicated editor - Find, replace, copy, paste, comment out, version control not always straightforward 25/11/2019 Enterprise Systems Seminars 3 User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction
  • 4.
  • 5.
    Textual Syntax +Editable withany text editor +Find, replace, copy, paste, comment out, version control practically solved - Text processed serially by the auditory system - Inaccessible to many non-CS stakeholders 25/11/2019 Enterprise Systems Seminars 5 User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction
  • 6.
    Textual vs. GraphicalSyntax • Text better for editing • Once you are familiar with the DSL and in the zone • Even for languages which are traditionally graph-like (e.g. state machines) • Diagrams better for understanding and presenting models to a wider audience 25/11/2019 Enterprise Systems Seminars 6 User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction
  • 7.
    Multiple Syntaxes • Implementa graphical and a textual editor • Edit on both sides and keep in sync • Challenging in practice • Graphical/textual frameworks developed by different vendors • Lots of plumbing involved • A few prototypes but cutting many corners 25/11/2019 Enterprise Systems Seminars 7 User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction
  • 8.
    Graphical Views • Textualsyntax for editing models • Generation of read- only graphical views • Challenges • Diagram layout • Fine-tuning (e.g. size, colour of elements/labels) 25/11/2019 Enterprise Systems Seminars 8 User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction
  • 9.
    Layout • Several decentoptions for automated graph layout e.g. • Graphviz • Eclipse Layout Kernel • DagreJS • Important that diagrams are kept reasonably small • But this is desirable anyway 25/11/2019 Enterprise Systems Seminars 9 User -> ATM: Inserts card ATM --> User: Requests PIN User -> ATM: Provides PIN ATM -> Bank: Check PIN against card Bank --> ATM: Accepts PIN ATM --> User: Asks for type of transaction
  • 10.
    Fine-Tuning public static voidmain(String[] args){ System.out.println("Hello world"); } 25/11/2019 Enterprise Systems Seminars 10
  • 11.
    Fine-Tuning public static voidmain(String[] args){ System.out.println("Helloworld"); } 25/11/2019 Enterprise Systems Seminars 11
  • 12.
    Flexmi and Picto •Flexmi: XML-based syntax for EMF models • Reflective and fuzzy parsing • Instantiable model element templates • Presented in a previous ES Seminar • Picto: Framework for model view generation and rendering • EMF models (for now) • Views in Graphviz, SVG, HTML • Views generated using M2T transformations (in EGL) • Both tools in the latest interim version of Epsilon (eclipse.org/epsilon) 25/11/2019 Enterprise Systems Seminars 12
  • 13.
  • 14.
    Picto – FutureWork • Layers • Declarative graphical syntax specification • Similar to Sirius/GMF/Eugenia • Navigation from view to model editor • Generation of views from multiple models • Integration with model validation • Change visualization • Web application 25/11/2019 Enterprise Systems Seminars 14

Editor's Notes

  • #4 1/3 of our brain is dedicated to processing visual input. Retyping is also a challenge.
  • #5 Won’t comment on scalability of graphical syntaxes: there are good ways to make graphical syntaxes scalable e.g. through the use of multiple diagrams.
  • #9 If you buy the argument that text is better for editing, two challenges remain.
  • #10 This doesn’t mean that your model should be small – but that each view you generate from it should be small. Actually, this diagram is auto-generated from the textual syntax above using a tool called PlantUML.
  • #11 Fine tuning is a matter of expectation.
  • #12 We would probably frown upon an IDE that allowed programmers to write code like this. Yes – fine-tuning would be nice to have but we have more important problems than that.
  • #15 UI polishing (e.g. custom icons, multiple Picto views/editors)