41
Xtext + Sirius : Cédric Brun <[email protected]> « Birth of Nature » Andrew Hamrock http://500px.com/photo/17743557

Xtext + Sirius = ♥ / EclipseCon Europe 2014

Embed Size (px)

DESCRIPTION

Xtext provides rich textual editing for your domain - aka "your own IDE" while Eclipse Sirius makes rich graphical editing a breeze for any kind of EMF model, but can they work together ? This talk will walk through all the possible integrations between those two technologies, from concurrently using the Xtext and Sirius editors on top of the same files to integrating the Xtext completion to a diagram or to a popup editor. It will also tackle the pitfalls and specific pain points one should be aware of.

Citation preview

Page 1: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Xtext + Sirius : ♥

Cédric Brun <[email protected]>

« Birth of Nature » And

rew Hamrock http://50

0px.com/photo/1774355

7

Page 2: Xtext + Sirius = ♥  / EclipseCon Europe 2014

«Xtext brings the capability of defining fairly quickly a textual editor supporting your domain specific concepts.»

« Sirius brings to anybody the capability of defining fairly quickly graphical, tree or table editors supporting your domain specific concepts. »

Page 3: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Textual + Graphical ?

Text is better:- at operations and sequence- when combining (expressions)- ...- for some users

Diagram is better : - relationships- analyzing a design- ...- for some users

Page 4: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Sirius

Page 5: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Sirius

Page 6: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Sirius

Page 7: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Sirius

Page 8: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Sirius

Page 9: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Sirius

Page 10: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Xtext

Page 11: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Xtext

Page 12: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Xtext

Page 13: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Xtext

Page 14: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The world of Xtext

Page 15: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Unexpected situations ?

Not so frequent situations for Sirius : - thousands of ressources in a single project - instance changes its URI/loose identity - serialization is not possible

Not so frequent situations for Xtext : - state is not serializable - model graph could not have been constructed through Xtext

Page 16: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Two views of the same model

File/Workspace level integrationDSL syntax used as the serialization formatDSL AST used in the Sirius Editor

Page 17: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The StateMachine Demo

Xtext 2.7.2Sirius 2.0.0Eclipse Luna SR1

https://github.com/ObeoNetwork/Xtext-Sirius-integration

Page 18: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : parsing errors

Page 19: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : parsing errors

Page 20: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : the referencing

href="my.statemachine#//@states.4"

href="my.statemachine#//@states[name='active']"

Page 21: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : Am I serializable ?

Page 22: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : Am I serializable ?

Provide graphical feedback ASAPTools should create serializable elements by defaultTools cleaning up the graph (Association like instances..)

Page 23: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Specific Integration with Xtext

Instantiate an XtextResourceSet Configure the ResourceSet with the project.Change the saving policy

Page 24: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : limitations addressed

[430724] Sirius might Serialize a bit too much[432931] Xtext prevent Serialization with false positives[448304] Xtext is not updating cross-ref names[..] DSL's with Xbase

Page 25: Xtext + Sirius = ♥  / EclipseCon Europe 2014

The Best of both

Page 26: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Embedding syntax in a diagramEmbedding

Page 27: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Embedding syntax in a diagram

Page 28: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Embedding syntax in a diagram

Page 29: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Embedding syntax in a diagram

Page 30: Xtext + Sirius = ♥  / EclipseCon Europe 2014

How To ?

Example and « base framework » here :https://github.com/ObeoNetwork/Xtext-viewpoint-integration

Page 31: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Behind the Scene

Page 32: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Behind the Scene

Page 33: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Behind the Scene

delta

merge

Page 34: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : Merging

Only as good as how the content matching performBad matching : nodes are re-created in diagram

Page 35: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : Cross-References Consistency

Model is parseable but not resolvable

Either prevent it* or warn the user !

Page 36: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Caveats : Cross-References Consistency

Model is parseable but not resolvable

Either prevent it* or warn the user !

These caveats should be considered upfront, it either impact the user experience or your DSL itself

Page 37: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Takeaways

● Sirius tuning: refresh and saving policy● Think about the referencing● Add editor feedback when not serializable● Design create/update/delete operations to stay

serializable● When embedding, display elements which should

not have cross-refs (or take care of those)● EMF Compare can help

Page 38: Xtext + Sirius = ♥  / EclipseCon Europe 2014

Takeaways

● As long as it's an EMF model Sirius will handle it.● If you want to embed : think about what you

expect ● Get involved : give feedback and or patches on the

embedding layer https://github.com/ObeoNetwork/Xtext-Sirius-integration

Page 39: Xtext + Sirius = ♥  / EclipseCon Europe 2014

What Next ?

Sirius 2.0● UX improvements for diagrams and layouts● Performance, scalability● ~110 Bugzillas delivered since June● EcoreTools 2, UML Designer 4 are based on Sirius

Eclipse Mars : ● Sirius goes 3.0 (*)● Scalability : hitting the 1 Million mark

(*) Model migrations are taken care of by Sirius

Page 40: Xtext + Sirius = ♥  / EclipseCon Europe 2014

other Talks

● Wednesday● How to make Sirius shine? – Maxime

● Wilhelm-Kramer-Zimmer - 11:15 to 11:50● Sirius + Xtext = - ♥ Cédric

● Theater - 13:45 to 14:20● Capella – Thales

● Theater - 15:15 to 15:50● Sirius BOF – Obeo

● Silchersaal – 19:00 to 20:00

● Thursday● On the road to Mars with Mars, thanks to Polarsys – Etienne

● Theater - 13:30 to 14:05

Page 41: Xtext + Sirius = ♥  / EclipseCon Europe 2014

http://www.eclipse.org/sirius/