Salvador Martínez is back again with new ATL developments, this time explaining the new Lazy ATL model (presented at the MoDELS 2011 conference, download the unedited version of the paper).

The increasing adoption of Model-Driven Engineering in industrial contexts highlights scalability as a critical limitation of several MDE tools. When these tools are built around model-to-model (M2M) transformations, the efficiency of the transformation engine risks to become a performance bottleneck for the whole MDE environment. Since most of the current model-to-model transformation engines have been designed for one-shot translation of input models to output models they present efficiency issues when applied to very large models (VLM). The following Figure shows how an standard M2M transformation engine works.

Lazy evaluation is a classical approach that is known to provide, under specific conditions, a significant speed-up in program execution, especially when manipulating large data structures. Therefore, lazy evaluation would significantly speed-up the execution of MDE tools based on M2M transformations, e.g., in cases where only part of the VLMs involved in the transformations is actually used. We study the application of lazy evaluation to M2M transformation languages as a twofold problem, encompassing lazy navigation of the source model and lazy generation of the target model. We focus though, in the second one.

Lazy model generation involves on-demand activation of the computation required to generate a data element of the target model. In our approach, a transformation engine with on-demand generation capabilities has to fulfill the following requirements:

  • To initiate the lazy generation process, consumption requests on the target model have to be tracked. This requires extending the model navigation mechanism the consumer uses, to intercept the requests and activate the corresponding generation in the transformation engine. For performing lazy access with the EMF API, the one ATL uses, we only need to override the eGet() method in the implementation of model elements, in order to trigger a call to the engine operations.
  • The transformation engine has to provide the means to launch the computation of a single model element or a single property of the target model. We achieve this by modifying the ATL compiler in order to generate and expose operation to launch individual rules and to calculate individual bindings.
  • Finally, the lazy engine can keep track of the status of the partial transformation, and use it as a context for the execution of new computations. The stored context is exploited by the lazy system to avoid recomputations.

Once the engine provides this infrastructure, a generic lazy generation algorithm works in three corresponding steps as can be seen in the following picture:

  1. The consumer requests a new target element, and the call gets intercepted by the navigation interface of the target model;
  2. The navigation interface (e.g., the lazy model) requests the engine to generate the single requested property or element;
  3. The engine determines the computations to activate, based on the current status of the transformation.

Our approach has been implemented in a prototype of a lazy transformation engine for the ATL language, obtained by adapting the standard ATL engine without modifying the language nor the virtual machine. Our experimentation shows that M2M transformation languages like ATL, with an explicit representation of the transformation logic, can be naturally provided with an efficient lazy evaluation strategy. Moreover, our approach to lazy generation allows the construction of an engine that can be plugged into existing tools consuming EMF models, without requiring modifications to the tools. The model is accessed like a normal EMF model, but its elements are computed on demand. Finally the lazy generation approach can be naturally applied to transformations that generate an unbounded target model. Only the part of the model explicitly requested by the consumer is generated. In this way finite computations can make use of infinite intermediate models generated by transformation. This represents a significant extension of the application space of existing transformation languages.

Want to build better software faster?

Want to build better software faster?

Read about the latest trends on software modeling and low-code development

You have Successfully Subscribed!

Pin It on Pinterest

Share This