Lessons learned from building Eclipse-based add-ons for commercial modeling tools (from a technology perspective) István Ráth Ákos Horváth EclipseCon France June 14 2018
MagicDraw A popular modeling tool for UML/SysML, available since 1998 Over 500.000 downloads in 90 countries Standard-compliant and highly customizable platform Not just a desktop app, but a complete suite of tools Simulation Analysis Collaboration! Teamwork Cloud
OpenMBEE: an open source ecosystem Open modeling platform Developed by NASA JPL and others Provides MMS collaborative repository with OpenAPI/ Swagger interfaces MDK MagicDraw client built with MD OpenAPI DocGen document generator for SysML models View Editor web-based front-end Integrations (Mathematica, bae, K, DOORS-NG, Matlab) A lot of useful and reusable code: https://github.com/open-mbee
IncQuery for MagicDraw TM and Teamwork Cloud TM
IncQuery cloud-based modeling beyond EMF
IncQuery cloud-based modeling beyond EMF Scalable Hybrid database technolog y Language tailored to models Validation and analytics features
IncQuery cloud-based modeling beyond EMF VIATRA query & xform engine Scalable In-memory index Hybrid database technolog y Language tailored to models Persistent index Validation and analytics features Tool / Repository
IncQuery cloud-based modeling beyond EMF VIATRA query & xform engine Scalable In-memory index Hybrid database technolog y Language tailored to models Persistent index Validation and analytics features Tool / Repository MagicDraw & Teamwork Cloud Traditional DBs NoSQL & graph DB GitHub,
IncQuery cloud-based modeling beyond EMF VIATRA query & xform engine Scalable In-memory index Hybrid database technolog y Language tailored to models Persistent index Validation and analytics features OpenAPI / Swagger interfaces High-performance indexing Change updates via callbacks Tool / Repository MagicDraw & Teamwork Cloud Traditional DBs NoSQL & graph DB GitHub,
IncQuery cloud-based modeling beyond EMF VIATRA query & xform engine Scalable Hybrid database technolog y Validation and analytics features Language tailored to models OpenAPI / Swagger interfaces High-performance indexing Change updates via callbacks In-memory index Persistent index Tool / Repository Clusterized NoSQL On-demand materialization Ecore only used for schema / ontology, no EMF instantiation MagicDraw & Teamwork Cloud Traditional DBs NoSQL & graph DB GitHub,
IncQuery cloud-based modeling beyond EMF Scalable VIATRA query & xform engine 1000x faster than conventional DB technology Hybrid database technolog y Validation and analytics features Language tailored to models OpenAPI / Swagger interfaces High-performance indexing Change updates via callbacks In-memory index Persistent index Tool / Repository Clusterized NoSQL On-demand materialization Ecore only used for schema / ontology, no EMF instantiation MagicDraw & Teamwork Cloud Traditional DBs NoSQL & graph DB GitHub,
IncQuery cloud-based modeling beyond EMF Hybrid database technolog y Scalable Validation and analytics features Language tailored to models Containerized microservices! Horizontal scaling in the cloud OpenAPI / Swagger interfaces High-performance indexing Change updates via callbacks VIATRA query & xform engine In-memory index Persistent index Tool / Repository 1000x faster than conventional DB technology Clusterized NoSQL On-demand materialization Ecore only used for schema / ontology, no EMF instantiation MagicDraw & Teamwork Cloud Traditional DBs NoSQL & graph DB GitHub,
Scenarios Model analysis and validation reporting (~ LGTM / FindBugs for models ) E.g. check if the signals sent/received over a port correspond to the flow properties identify cyclic activity calls find deadlock states, i.e. incoming transitions but not outgoing Etc. Change impact analysis If I change an upstream project, how will it affect downstream projects? Fast queries! realizable in pre-commit hooks Ad-hoc model queries Model comprehension Reviews Traceability analysis
IncQuery for MagicDraw and Teamwork Cloud Screenshots
IncQuery for MagicDraw and Teamwork Cloud Screenshots
IncQuery for MagicDraw and Teamwork Cloud Screenshots
http://eclipse.org/viatra IncQuery is built on open source Model query and transformation framework Declarative Scalable Reactive Easy integration Java & other JVM languages Enabling libraries for open & commercial tools Major industrial users & partners:
http://eclipse.org/viatra IncQuery is built on open source Model query and transformation framework Declarative Scalable Reactive Easy integration Java & other JVM languages Enabling libraries for open & commercial tools Major industrial users & partners: What s new in VIATRA 2.0? Simplification Fewer third party dependencies New language features Lots of performance and memory optimizations Java compatibility (Java 8 required & used on API, Java 9/10 supported) Available in Eclipse Photon!
MagicDraw and EMF Lesson #1 Custom EMF metamodel for UML Incompatible with MDT.UML Most visible difference: profile support Applied profiles and stereotypes can be referenced by name string typing Lesson #2 Custom EMF implementation Mostly EMF-compatible, including change notifications! (support incremental processing out-of-the box) Custom memory management (loading-unloading in the background) Custom transaction handling
MagicDraw and EMF Lesson #1 Custom EMF metamodel for UML Incompatible with MDT.UML Most visible difference: profile support V4MD: VIATRA for MagicDraw Applied profiles and stereotypes can be referenced by name string typing Open source glue code (EPL v2) Demonstrates how to bind EMF-based Mostly EMF-compatible, including tech change to MagicDraw notifications! (support incremental processing out-of-the Deployable box) as a MD plug-in built with Custom memory management (loading-unloading Gradle in the background) Custom transaction handling http://github.com/viatra/v4md Lesson #2 Custom EMF implementation
MagicDraw vs. OSGi MD 18.x+ is based on Eclipse Equinox not entirely: the application itself is, but Lesson #3 MagicDraw plug-ins are not OSGi bundles No classpath separation MagicDraw API cannot be referenced as OSGi dependencies Lesson #4 Custom plugin.xml format Incompatible with PDE
Lesson #5: Integrating Xtext into MagicDraw Parsing infrastructure is easy to reuse, but... As standalone Java application Maven dependencies useful... a full-blown editor integration is tricky Many dependencies, including SWT and JDT Integrating SWT-based UI into Swing is not practical Alternatives we considered: Future proof: Web-based editor with LSP Quick-and-dirty: Separate Eclipse RCP based application
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser RCP-based companion app
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser RCP-based companion app No dependency issues inside MagicDraw But requires a 200MB RCP app (per platform)
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser RCP-based companion app No dependency issues inside MagicDraw But requires a 200MB RCP app (per platform) Just works Custom protocol for communication
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser RCP-based companion app No dependency issues inside MagicDraw But requires a 200MB RCP app (per platform) Just works Custom protocol for communication Can host the language server A path forward as technology matures
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser RCP-based companion app No dependency issues inside MagicDraw But requires a 200MB RCP app (per platform) Just works Custom protocol for communication Can host the language server A path forward as technology matures Platform specific issues with window management
Alternatives: LSP vs. RCP LSP Deploy language server within MD! dependency issues Potential collusions with built-in jars No mature LSP client for Swing UI Monaco editor has issues with builtin browser RCP-based companion app No dependency issues inside MagicDraw But requires a 200MB RCP app (per platform) Just works Custom protocol for communication Can host the language server A path forward as technology matures Platform specific issues with window management
A "companion app for MagicDraw: The VIATRA Query Language Editor Keywords in purple Pattern that lists SysML Blocks UML Types Simple UML path expressions Check expressions https://www.eclipse.org/viatra/documentation/tutorial.html https://www.eclipse.org/viatra/documentation/query-language.html
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language Solution: Gradle
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language Solution: Gradle Originates from OpenMBEE project Gradle-based solution Relies on scripting
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language Solution: Gradle Originates from OpenMBEE project Gradle-based solution Relies on scripting MagicDraw OpenAPI dependencies Download and install MagicDraw instance Use as dependency source
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language Solution: Gradle Originates from OpenMBEE project Gradle-based solution Relies on scripting MagicDraw OpenAPI dependencies Download and install MagicDraw instance Use as dependency source External dependencies Downloaded via standard Gradle mechanisms Script can update plugin and installation descriptor files
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language Solution: Gradle Originates from OpenMBEE project Gradle-based solution Relies on scripting MagicDraw OpenAPI dependencies Download and install MagicDraw instance Use as dependency source External dependencies Downloaded via standard Gradle mechanisms Script can update plugin and installation descriptor files Generated code Handled via Gradle plugins
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format Handling generated code VIATRA VQL language Xtend language Solution: Gradle Originates from OpenMBEE project Gradle-based solution Relies on scripting MagicDraw OpenAPI dependencies Download and install MagicDraw instance Use as dependency source External dependencies Downloaded via standard Gradle mechanisms Script can update plugin and installation descriptor files Generated code Handled via Gradle plugins Running MagicDraw Starts the Platform Runner of MagicDraw Parameterized with the Gradle Java Runner
Lesson #6: Building MagicDraw plugins Challenges Collect jars from a MagicDraw installation Non-standard solution Execute new MagicDraw instance with plug-in Starting an OSGi container is non-trivial Add third-party dependencies Maven dependencies Plugin descriptors have to include all jar files by name Separate installation descriptor as well in a different format MD Plugin Skeleton Handling generated code VIATRA VQL language Xtend language Solution: Gradle Originates from OpenMBEE project Gradle-based solution Relies on scripting MagicDraw OpenAPI dependencies Download and install MagicDraw instance Use as dependency source External dependencies Downloaded via standard Gradle mechanisms Script can update plugin and installation descriptor files Generated code Handled via Gradle plugins Hello world plugin based on the Gradle setup Easy to reuse https://github.com/incquerylabs/md_plugin_skeleton Running MagicDraw Starts the Platform Runner of MagicDraw Parameterized with the Gradle Java Runner
Some more open source contributions MD VIATRA benchmark https://github.com/incquerylabs/magicdraw-viatra-benchmark Scalability benchmark for VIATRA queries over MagicDraw models TMT model fork https://github.com/incquerylabs/tmt-sysml-model Large (300k+) real-world SysML model, very useful to testing tools Examples of actual IQ4MD validation rules inspired by NASA JPL MDK fork https://github.com/incquerylabs/mdk Example usage of V4MD within MDK, NASA JPL s toolkit
Takeaways
Takeaways Integrating with proprietary tools is more challenging... Compared to a purely open Eclipse ecosystem... But not that hard with the proper tools
Takeaways Integrating with proprietary tools is more challenging... Compared to a purely open Eclipse ecosystem... But not that hard with the proper tools No Magic is an open and collaborative partner Open ecosystem around MD (on a smaller scale) is worth exploring And contributing to!
Takeaways Integrating with proprietary tools is more challenging... Compared to a purely open Eclipse ecosystem... But not that hard with the proper tools No Magic is an open and collaborative partner Open ecosystem around MD (on a smaller scale) is worth exploring And contributing to! Watch out for VIATRA 2.0 and the IncQuery Server
Takeaways Integrating with proprietary tools is more challenging... Compared to a purely open Eclipse ecosystem... But not that hard with the proper tools No Magic is an open and collaborative partner Open ecosystem around MD (on a smaller scale) is worth exploring And contributing to! Watch out for VIATRA 2.0 and the IncQuery Server Get the IncQuery MagicDraw plug-in at https:// incquerylabs.com/incquery Complete with tutorial and examples
Takeaways Integrating with proprietary tools is more challenging... Compared to a purely open Eclipse ecosystem... But not that hard with the proper tools No Magic is an open and collaborative partner Open ecosystem around MD (on a smaller scale) is worth exploring And contributing to! Watch out for VIATRA 2.0 and the IncQuery Server Get the IncQuery MagicDraw plug-in at https:// incquerylabs.com/incquery Complete with tutorial and examples
Thank you! http://iq4md.incquerylabs.com iq4md AT incquerylabs.com info AT incquerylabs.com +36 70 633 3973 @IncQueryLabs