days
0
-66
-9
hours
0
-2
minutes
-3
-7
seconds
-3
-1
search
Scalable reactive model transformations

What is Eclipse VIATRA?

István Rath, Gábor Bergmann, and Zoltán Ujhelyi
MicroProfile
© Shutterstock / Sadovski

Eclipse Viatra is a model query and transformation framework to efficiently move information back and forth between various documents and models. This overview looks at what’s new in Viatra 2.0 and how it can be used beyond the Eclipse Modeling Framework.

The Eclipse VIATRA project provides a model query and transformation framework that helps to move information back and forth between various documents and models in the most efficient way. The framework supports the reactive programming paradigm by event-driven transformations that can happen on-the-fly as the models change.

viatra

While trivial transformations (for instance copying pieces of data from one document to another) are easy to solve with any programming language, the task quickly becomes too challenging for those who need to enforce complex design rules or produce live reports.

VIATRA is a long-running project that incorporates the results of over 15 years of active research and development to solve this issue. The framework offers an efficient Java runtime library that is easy to embed, e.g. with limited dependencies. In addition to that, dedicated domain-specific query and transformation languages are available, motivated by the concepts of graph patterns and graph transformations.

viatra

Listing 1: A query over state machines expressed as a graph pattern

To illustrate the capabilities of VIATRA, a complete model case study called CPS demonstrator was created. The showcase includes model queries, transformations in multiple styles (batch, live, target incremental, etc.) and a model generator. Furthermore, the ease of embedding VIATRA is demonstrated by creating a dedicated modeling application that integrates all these features.

Query and transformation performance depends on the domain complexity and the size of the models. VIATRA was already successfully applied to complex domains such as UML or AutoSAR and handled models up to millions of model elements. To achieve this kind of scalability, it is possible to configure the execution in detail, including the selection of the algorithm used by the model queries.

The queries and transformation available in the CPS demonstrator are also used to benchmark the capabilities of the framework. The benchmark code is available and is executed regularly to detect performance regressions during development.

To learn more about the VIATRA framework, we suggest having a look at the comprehensive documentation of the project, especially the getting started tutorial.

What’s new in VIATRA 2.0?

Eclipse Photon will include version 2.0 of the VIATRA framework. The main goals of the new release were to both simplify and modernize the existing code of the project.

One aspect of this modernization was to require Java 8 as a minimum dependency, allowing features such as lazily calculated query results via a stream-friendly API. Naturally, it was also seen to that everything works with Java 9 and 10 as well.

VIATRA

Listing 2: Processing the results of the query using the new Stream API

The query language was also enhanced with a few new features that makes pattern definitions simpler, e.g. by reducing the need for trivial patterns like ones enumerating all instances of a given class. In addition to these changes, version 2.0 includes fixes and performance optimizations to ensure VIATRA works as expected in as many environments and workloads as possible.

Of course the development of VIATRA will not stop after the release. In fact, the planning of VIATRA 2.1 has already begun. We plan to maintain our cadence of two new feature releases per year after Photon, so VIATRA 2.1 is planned for Eclipse 2018-12. With regards to planned features, work has begun on a graphical query editor using Sirius. This editor will provide an alternate way to create and review model queries while maintaining compatibility with the existing runtime.

Using VIATRA beyond EMF

Although VIATRA was originally designed for the needs of model-driven engineering tools based on the Eclipse Modeling Framework (EMF), the VIATRA core itself can be applied to other modeling or engineering tools. Version 2.0 introduces new API enhancements that make it easier to develop such model access connectors in additional, heterogeneous technological spaces.

Based on these capabilities, several open source and commercial adaptations have been developed, including the INCA tool that analyses software code created in IDEs including mbeddr. Recently, VIATRA 2.0 was also successfully integrated with MagicDraw and Teamwork Cloud, a popular commercial UML/SysML modeling and collaboration platform. Some aspects of this integration have been released as open source (V4MD), while others empower commercial products aimed at scalable cloud-based modeling (IncQuery for MagicDraw and the IncQuery Server). To learn more about these developments, check out our EclipseCon France 2018 presentation.

Links

 

eclipseorb_color

This post was originally published in the June 2018 issue of the Eclipse Newsletter: Eclipse Photon – A Quantum Leap

For more information and articles check out the Eclipse Newsletter.

Author

István Rath, Gábor Bergmann, and Zoltán Ujhelyi

Istvan Rath is the CEO and co-founder at IncQuery Labs, co-founder at QGears, and a research fellow at BME. He is the co-Lead of VIATRA. Follow him on Twitter @istvanrath.

 

Gábor Bergmann is a co-founder at IncQuery Labs and a research fellow at BME.

 

Zoltán Ujhelyi is a Technology expert at IncQuery Labs working Eclipse technologies with a PhD related to model queries and transformations. Co-lead of the VIATRA Eclipse project. Follow him on Twitter @stampiehun

 


guest
0 Comments
Inline Feedbacks
View all comments