SlideShare une entreprise Scribd logo
1  sur  24
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 ECE2017#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
Blog post “Linking Xtext Models With EMF Models”
And a White Paper “Xtext / Sirius - Integration, The Main Use-Cases” coming soon.
Evaluate the Sessions
Sign in and vote at eclipsecon.org
- 1 + 10

Contenu connexe

Tendances

Mining top k frequent closed itemsets
Mining top k frequent closed itemsetsMining top k frequent closed itemsets
Mining top k frequent closed itemsets
yuanchung
 

Tendances (20)

Deep Learning meetup
Deep Learning meetupDeep Learning meetup
Deep Learning meetup
 
4 heapsort pq
4 heapsort pq4 heapsort pq
4 heapsort pq
 
Unit 5 dsa QUEUE
Unit 5 dsa QUEUEUnit 5 dsa QUEUE
Unit 5 dsa QUEUE
 
Using the Meta-Environment for Model-Driven Engineering
Using the Meta-Environment for Model-Driven EngineeringUsing the Meta-Environment for Model-Driven Engineering
Using the Meta-Environment for Model-Driven Engineering
 
Gremlin Queries with DataStax Enterprise Graph
Gremlin Queries with DataStax Enterprise GraphGremlin Queries with DataStax Enterprise Graph
Gremlin Queries with DataStax Enterprise Graph
 
Data Structures 01
Data Structures 01Data Structures 01
Data Structures 01
 
Sorting
SortingSorting
Sorting
 
003 20151109 nn_faster_andfaster
003 20151109 nn_faster_andfaster003 20151109 nn_faster_andfaster
003 20151109 nn_faster_andfaster
 
Link List
Link ListLink List
Link List
 
Basic Traversal and Search Techniques
Basic Traversal and Search TechniquesBasic Traversal and Search Techniques
Basic Traversal and Search Techniques
 
Basic Traversal and Search Techniques
Basic Traversal and Search TechniquesBasic Traversal and Search Techniques
Basic Traversal and Search Techniques
 
Lec3
Lec3Lec3
Lec3
 
Stack implementations
Stack implementationsStack implementations
Stack implementations
 
Programming in c plus plus4
Programming in c plus plus4Programming in c plus plus4
Programming in c plus plus4
 
Applications of Stack in DSA
Applications of Stack in DSAApplications of Stack in DSA
Applications of Stack in DSA
 
Mining top k frequent closed itemsets
Mining top k frequent closed itemsetsMining top k frequent closed itemsets
Mining top k frequent closed itemsets
 
Concepts of Arrays
Concepts of ArraysConcepts of Arrays
Concepts of Arrays
 
Introduction To Using TensorFlow & Deep Learning
Introduction To Using TensorFlow & Deep LearningIntroduction To Using TensorFlow & Deep Learning
Introduction To Using TensorFlow & Deep Learning
 
Queue
QueueQueue
Queue
 
Recommender System Challenge
Recommender System ChallengeRecommender System Challenge
Recommender System Challenge
 

Similaire à Integrating Xtext and Sirius: Strategies and Pitfalls

Chapter 13 introduction to classes
Chapter 13 introduction to classesChapter 13 introduction to classes
Chapter 13 introduction to classes
rsnyder3601
 

Similaire à Integrating Xtext and Sirius: Strategies and Pitfalls (20)

Xtext + Sirius = &lt;3
Xtext + Sirius = &lt;3Xtext + Sirius = &lt;3
Xtext + Sirius = &lt;3
 
Data Engineer’s Lunch #41: PygramETL
Data Engineer’s Lunch #41: PygramETLData Engineer’s Lunch #41: PygramETL
Data Engineer’s Lunch #41: PygramETL
 
Chapter 13 introduction to classes
Chapter 13 introduction to classesChapter 13 introduction to classes
Chapter 13 introduction to classes
 
PATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design PatternsPATTERNS04 - Structural Design Patterns
PATTERNS04 - Structural Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
templates.ppt
templates.ppttemplates.ppt
templates.ppt
 
Avogadro 2 and Open Chemistry
Avogadro 2 and Open ChemistryAvogadro 2 and Open Chemistry
Avogadro 2 and Open Chemistry
 
Understanding Implicits in Scala
Understanding Implicits in ScalaUnderstanding Implicits in Scala
Understanding Implicits in Scala
 
Style & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design PatternsStyle & Design Principles 02 - Design Patterns
Style & Design Principles 02 - Design Patterns
 
Design patterns for fun & profit - CoderCruise 2018
Design patterns for fun & profit - CoderCruise 2018Design patterns for fun & profit - CoderCruise 2018
Design patterns for fun & profit - CoderCruise 2018
 
Core concepts of C++
Core concepts of C++  Core concepts of C++
Core concepts of C++
 
Balisage - EXPath Packaging
Balisage - EXPath PackagingBalisage - EXPath Packaging
Balisage - EXPath Packaging
 
Advanced PHP Simplified
Advanced PHP SimplifiedAdvanced PHP Simplified
Advanced PHP Simplified
 
Test1
Test1Test1
Test1
 
Test1
Test1Test1
Test1
 
Test1
Test1Test1
Test1
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 

Plus de Cédric Brun

EcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessibleEcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessible
Cédric Brun
 
Modeling avengers – open source technology mix for saving the world econ fr
Modeling avengers – open source technology mix for saving the world econ frModeling avengers – open source technology mix for saving the world econ fr
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
Modeling avengers – open source technology mix for saving the worldModeling avengers – open source technology mix for saving the world
Modeling avengers – open source technology mix for saving the world
Cédric Brun
 
From Acceleo.org To Eclipse Modeling
From Acceleo.org To Eclipse ModelingFrom Acceleo.org To Eclipse Modeling
From Acceleo.org To Eclipse Modeling
Cédric Brun
 
Acceleo Day - Acceleo Mtl Code Generation
Acceleo Day - Acceleo Mtl Code GenerationAcceleo Day - Acceleo Mtl Code Generation
Acceleo Day - Acceleo Mtl Code Generation
Cédric Brun
 

Plus de Cédric Brun (17)

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

Dernier

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Integrating Xtext and Sirius: Strategies and Pitfalls