SlideShare a Scribd company logo
Integrating
Xtext and Sirius:
Strategies and Pitfalls
Cédric Brun (Obeo) – Jan Köhnlein (TypeFox)
Agenda
● Three modes of integration
○ Persisting the model using Xtext
○ References between Xtext and Sirius models
○ Embedding an Xtext editor in Sirius
● Conclusion
Persisting the
Model Using
Xtext
Diagram Model vs Semantic Model
Sirius
ProjectResourceSet
foo.aird
diagram model
foo.flow
semantic model
by default persisted as XMIResources
foo.xflow
semantic model
XtextResource
parser
serializer
text
file
EObjects
getContents()
load()
save()
fragment provider
getURIFragment(EObject)
getEObject(fragment)
Persist the Semantic Model with Xtext
Sync through filesystem
Diagram Refresh Strategy
● Automatic Refresh (default)
○ lead to diagram re-init when the model is un-parseable
○ diagram content gets lost
● Setup a specific strategy to trigger the refresh
Grammar Adaptations
● Avoid errors when the user tries to save
● Not every string is an ID
○ Consider using STRING rule instead of ID in the
grammar
● Lose grammar, strict validation
● Tools should create serializable elements
by default
● Highlight offending elements in diagram
Concurrent Dirty States
Prevent editing in the other
syntax when one is dirty
References
Between
Xtext and Sirius
Models
Xtext and Sirius Models Combined
Xtext and Sirius are aware of each others models
Cross-references
between them
EMF Cross-references
ResourceSet foo.x
XMI model
bar.y
Xtext model
cross
references
XMI uses URIs: href=”<resource URI>#<fragment>”
e.g. href=”bar.y#ab378f1789d1”
Names vs URIs
I am giving this talk with Cédric.
Name-based linking (Xtext)
I am giving this talk with ECF2017#116.
URI-based linking (Sirius)
Resolution mechanism
Coupling of resources
Syntax errors
Rename
Suitability for users
Differences
Models And Identities
Editor
foo.dsl
ResourceSet
baz.dsl
foo.dsl
Editor
bar.dsl
ResourceSet
foo.dsl
bar.dsl
Project
ResourceSet
baz.dsl
foo.dsl bar.dsl
*.dsl
Xtext Sirius
Make Sirius Refer to Xtext
● Implement an IFragmentProvider
○ make name (and type) part of the XMI-ID
● Implement Xtext support for *.aird files
○ allows Sirius to participate in Xtext rename refactoring
● Navigate to Xtext editor from the diagram
● Define fixed synchronization points
● Compare based on compare & merge instead of plain reload
Make Xtext Refer to Sirius/XMI
● Implement Xtext support for the XMI model
○ make elements referable from Xtext
○ make cross-links openable
○ participate in Xtext refactorings
● Navigate to Sirius editor from Xtext
● Rename on the Sirius side must trigger a rename refactoring in Xtext
Either way
● Cross-referencing will rely on the Xtext index
○ Xtext nature on project + build-automatically must be on
○ check the index with CTRL-SHIFT-F3
● Dirty-state integration is tricky
○ Refs from Xtext are not updated correctly when Sirius model changes
○ Avoid Xtext rename refactoring when diagram has unsaved changes
Embedding an
Xtext Editor
into Sirius
Embedding Xtext
XtextEmbeddedEditor +
Custom properties widget
Store Xtext model in a
string-valued attribute
Requires Pretty Deep Integration
● Configuring XtextEmbededdEditor widget
● Syncing Transactions
● Using Sirius dirty state instead of the last-saved state
● Rename refactoring will be hard
Conclusion
You can integrate Xtext and Sirius
● Use EMF as the base of any kind of integration
● Basic level of integration is quite easy
● Deep integration can be tricky, keep an eye on
○ Linking cross-references
○ Using resource sets
○ Transactions
○ Consistency
● But in the end you’ll get a great tool mixing textual and graphical representations
Examples are online
● FowlerDSL: https://github.com/ObeoNetwork/Xtext-Sirius-integration/
● Farming (Gemoc) : https://github.com/gemoc/farmingmodeling
● Flow: https://github.com/ObeoNetwork/Flow-Designer

More Related Content

PDF
Integrating Xtext and Sirius: Strategies and Pitfalls
Cédric Brun
 
PDF
SiriusCon 2017 - Integrating Xtext and Sirius: Strategies and Pitfalls
Obeo
 
PDF
Xtext + Sirius = ♥ / EclipseCon Europe 2014
Cédric Brun
 
PPTX
Dataweave types operators
Ramakrishna kapa
 
PPT
basics of queues
sirmanohar
 
PDF
Hyperparameter Optimization with Hyperband Algorithm
Deep Learning Italia
 
PDF
Using the Meta-Environment for Model-Driven Engineering
ESUG
 
PDF
4 heapsort pq
hasan Mohammad
 
Integrating Xtext and Sirius: Strategies and Pitfalls
Cédric Brun
 
SiriusCon 2017 - Integrating Xtext and Sirius: Strategies and Pitfalls
Obeo
 
Xtext + Sirius = ♥ / EclipseCon Europe 2014
Cédric Brun
 
Dataweave types operators
Ramakrishna kapa
 
basics of queues
sirmanohar
 
Hyperparameter Optimization with Hyperband Algorithm
Deep Learning Italia
 
Using the Meta-Environment for Model-Driven Engineering
ESUG
 
4 heapsort pq
hasan Mohammad
 

What's hot (10)

ODP
Hubba Deep Learning
Ivan Goloskokovic
 
ODP
Plyr
raginihacks
 
ODP
Deep Learning meetup
Ivan Goloskokovic
 
PPTX
Accelerating NLP with Dask on Saturn Cloud: A case study with CORD-19
Sujit Pal
 
PDF
Data Structures 01
Budditha Hettige
 
PDF
Swarm.js: реактивная синхронизация данных — Виктор Грищенко — MoscowJS 13
MoscowJS
 
PDF
Sorting
Budditha Hettige
 
PDF
Kaggle tokyo 2018
Cournapeau David
 
PDF
Vsm lsi
Ryan Wang
 
Hubba Deep Learning
Ivan Goloskokovic
 
Deep Learning meetup
Ivan Goloskokovic
 
Accelerating NLP with Dask on Saturn Cloud: A case study with CORD-19
Sujit Pal
 
Data Structures 01
Budditha Hettige
 
Swarm.js: реактивная синхронизация данных — Виктор Грищенко — MoscowJS 13
MoscowJS
 
Kaggle tokyo 2018
Cournapeau David
 
Vsm lsi
Ryan Wang
 
Ad

Similar to Integrating Xtext and Sirius: Strategies and Pitfalls (11)

PDF
Xtext + Sirius = &lt;3
mporhel
 
PDF
Xtext + Sirius = &lt;3
Cédric Brun
 
PDF
[Siriuscon2018] Integrating Sirius, Xtext and EMF Compare to Design Simulato...
Obeo
 
PPTX
V for visualization: VIATRA finally goes graphical thanks to Sirius!
Ákos Horváth
 
PDF
Roadmap - SiriusCon2016
Cédric Brun
 
PDF
How to make Robust and Scalable Modeling Workbenches with Sirius - SiriusCon ...
mporhel
 
PDF
How to Make Robust and Scalable Modeling Workbenches with Sirius - EclipseCon...
mporhel
 
PDF
Integration Service: Integrating Communication Protocols
eProsima
 
PDF
ApacheCon 2000 Everything you ever wanted to know about XML Parsing
Ted Leung
 
PDF
Robust Real-Time Synchronization between Textual and Graphical Editors
Oskar van Rest
 
PPT
ITU - MDD - XText
Tonny Madsen
 
Xtext + Sirius = &lt;3
mporhel
 
Xtext + Sirius = &lt;3
Cédric Brun
 
[Siriuscon2018] Integrating Sirius, Xtext and EMF Compare to Design Simulato...
Obeo
 
V for visualization: VIATRA finally goes graphical thanks to Sirius!
Ákos Horváth
 
Roadmap - SiriusCon2016
Cédric Brun
 
How to make Robust and Scalable Modeling Workbenches with Sirius - SiriusCon ...
mporhel
 
How to Make Robust and Scalable Modeling Workbenches with Sirius - EclipseCon...
mporhel
 
Integration Service: Integrating Communication Protocols
eProsima
 
ApacheCon 2000 Everything you ever wanted to know about XML Parsing
Ted Leung
 
Robust Real-Time Synchronization between Textual and Graphical Editors
Oskar van Rest
 
ITU - MDD - XText
Tonny Madsen
 
Ad

More from Cédric Brun (16)

PDF
Eclipse Modeling Guided Tour - EMF Compare
Cédric Brun
 
PDF
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Cédric Brun
 
PDF
Eclipse Modeling Guided Tour - EcoreTools
Cédric Brun
 
ODP
EcoreTools-Next: Executable DSL made (more) accessible
Cédric Brun
 
PDF
Modeling avengers – open source technology mix for saving the world econ fr
Cédric Brun
 
PDF
Modeling avengers – open source technology mix for saving the world
Cédric Brun
 
PDF
15 EMF projects in 25 minutes
Cédric Brun
 
PDF
What the heck is Eclipse Modeling and why should you care !
Cédric Brun
 
PDF
Breathe life into your designer!
Cédric Brun
 
PDF
Sirius : origins, present, future
Cédric Brun
 
PDF
Ecore Tools 2.0 : The Luna Revival
Cédric Brun
 
PDF
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
Cédric Brun
 
PDF
What every developer should know about EMF Compare
Cédric Brun
 
PDF
From Acceleo.org To Eclipse Modeling
Cédric Brun
 
ODP
Acceleo Day - Acceleo Mtl Code Generation
Cédric Brun
 
PDF
Team Work With Models Web
Cédric Brun
 
Eclipse Modeling Guided Tour - EMF Compare
Cédric Brun
 
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Cédric Brun
 
Eclipse Modeling Guided Tour - EcoreTools
Cédric Brun
 
EcoreTools-Next: Executable DSL made (more) accessible
Cédric Brun
 
Modeling avengers – open source technology mix for saving the world econ fr
Cédric Brun
 
Modeling avengers – open source technology mix for saving the world
Cédric Brun
 
15 EMF projects in 25 minutes
Cédric Brun
 
What the heck is Eclipse Modeling and why should you care !
Cédric Brun
 
Breathe life into your designer!
Cédric Brun
 
Sirius : origins, present, future
Cédric Brun
 
Ecore Tools 2.0 : The Luna Revival
Cédric Brun
 
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
Cédric Brun
 
What every developer should know about EMF Compare
Cédric Brun
 
From Acceleo.org To Eclipse Modeling
Cédric Brun
 
Acceleo Day - Acceleo Mtl Code Generation
Cédric Brun
 
Team Work With Models Web
Cédric Brun
 

Recently uploaded (20)

PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PPTX
Introduction of deep learning in cse.pptx
fizarcse
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Principles of Food Science and Nutritions
Dr. Yogesh Kumar Kosariya
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
Introduction of deep learning in cse.pptx
fizarcse
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
Information Retrieval and Extraction - Module 7
premSankar19
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 

Integrating Xtext and Sirius: Strategies and Pitfalls