Skip to main content

ATL Basic Examples and Patterns

This section provides a set of basic examples and patterns.

Families to Persons

February 2007

This presentation describes a very simple model transformation example, some kind of ATL “hello world”.

ATL concepts encountered: Header section, Helper functions, Matched rules

Additional concepts encountered: Metamodel and conformance relation, ATL IDE (ADT)

Tree to List

July 2007

This transformation presents a basic example where a tree is transformed into a list. This kind of transformation is usually made by an imperative Depth First Traversal algorithm.

ATL concepts encountered: Matched rules (one with a guard), Helper functions (one being recursive), Collection related functions, Enumeration, and ATL resolve algorithm.

List Metamodel Refactoring

December 2007

In this example, we present some basic concepts of ATL through a simple use case. Our working context is the creation of a bridge between two different versions of a List metamodel (A and B). This bridge consists on an ATL transformation from the version A to the version B.

ATL concepts encountered: Automatic traceability support in ATL, Handling collection, and String operation.

Port

January 2008

In this example, we present some basic concepts of ATL through a simple use case. This use case deals with situations where the source element meta type could not be simply matched with the target meta type. The only way to resolve the target meta type is to browse source model.

ATL concepts encountered: Matched rules and lazy (matched) rules, Avoiding some imperative constructs, and Code optimization.

Side Effect

January 2008

This case deals with the way to handle side effects induced while transforming an element. We will start from an imperative algorithm to create a transformation between two metamodels. This algorithm will introduce a side effect problem. After several iteration a solution will be provided following ATL philosophy.

ATL concepts encountered: ATL imperative parts for dealing with complex situation, and Chain of ATL transformations to divide transformation complexity and to avoid imperative parts.

Back to the top